Import Strava activity information to a Notion database. Subsequent uploads use the most recent entry in the notion database to not double sync.
Inspired by IVIURRAY and updated for the new Notion API.
- Create an App though the Strava API (I used media/notion_icon.png for the image).
- Insert
Client ID
andClient Secret
intoconfig.py
. - Create an app through the Notion API (I used media/strava_icon.png for the image). Add your secret ID to
config.py
asTOKEN_V3
. - Create a database (create this as a blank database page) in notion, copy the ID to config file. Give your notion integration access to the data base (share button).
- Add the relevant columns to the database, the default needs Name, Type (select), Length (number), Time (number), Date (date), Power (number), Elevation (number), Strava Link (URL). You can customise these in the
notion_api_new.py
file.
git clone https://github.com/jakesw/strava_to_notion_exporter.git
cd strava_to_notion_exporter
- create a new environment from
requirements.txt
python3 strava_api.py
This will open a browser to ask you to authenticate the integration, I had issues running this in WSL.- For subsequent runs set
All_Data
inconfig.py
toFalse
and it will only upload your new activities.
The notion_api_test.py
file is left in for you to test adding different data to the database. See Strava API for what other data is taken from the API request.
Copy the link to your database page that will look like: https://www.notion.so/<long_hash_1>?v=<long_hash_2>
then choose <long_hash_1>
, this is the database ID.
The HTTP Requests are abstracted away by two helpful libraries: stravio and notion-sdk-py. This documentation coupled with the official API documentation is useful for debugging and customising.