This script makes tracking videogames with Notion databases more delightful by automatically adding images and metadata about the games you have played or want to play.
It does so by fetching data from various places around the internet (Steam, SteamGrid, IGDB, Youtube, HLTB) and using the Notion API to connect it to your database.
If you want to see the results, you can take a look at a minimalist example or my lovely collection.
The code could still be improved in various places, but c'mon, this bot is trying his hardest to make your game collection shine, who could judge him for being a bit messy?
These steps are needed for both deployment and development.
- Clone the repository
- Rename
config.py.template
toconfig.py
and enter the following keys:- Create a Steamgrid-API-Key
- Create a IGDB Client ID and secret
- Create an application and a Youtube-API-Key
- Create an application and a Notion-API-Key
- Go to the example page,
Duplicate
the page, and delete the example entries - Share the database you cloned with the Notion application you created and enter the database link into the
config.py
For the deployment on your Linux machine, you will need both docker and docker-compose.
To build the docker image, run
docker-compose build
in the root directory.
After completing the setup, start the container with
docker-compose up -d
Stop the server with
docker-compose down
For development, you will need a Python3 installation.
To install the dependencies, run
python3 -m pip install -r requirements.txt
in the root directory.
To start the script, run
python3 main.py
in the root directory.
Once the script is running (either locally or on your server), head over to the databse that you cloned.
You can load the game data by setting the Data Fetched
property. Use Load All
to set properties and page data and use Load Images
to refetch the icon, cover, and hero in case the links die.
The game will be identified either using the games Steam-ID or its name:
- If the
SteamID
property is set, the game data will be loaded and all other fields will be updated accordingly. If possible/sensible, the images will be taken directly from Steam. - If no
SteamID
is present, the name will be used to load the game data, with all image properties being filled by SteamGrid. The title of the page will stay unaffected.
It will take a couple of seconds for your data to update. You are free to add as many custom properties to the pages as you like, as long as you do not alter the properties that were copied from the example page (you can, however, move/hide them without breaking the code).
- Adrian Steffan - adriansteffan website