A simple command line tool which fetches series and movie data from Movie DB to be formatted as a Notion page.
pip install -r requirements.txt
You should include these keys under your .env file.
MY_NOTION_TOKEN =""
DATABASE_ID = ""
Follow Notion - Getting Started to create a new integration. Note: Remember to grant permissions to the integration in your database
! Your Notion DB headers should match the property you want to include. You can modify the property under createpage2.py.
API_READ_ACCESS_TOKEN = ""
Follow Movie DB - Getting Started to create a new API key.
Click module was used in making the command line. See more information below. Click - Quick Start
- connection: Checks connection to Notion database and MovieDB
- movie: Add movie page
- series: Add series page
- Prompted to enter movie/series title
- Displays available movies/series queried from MovieDB API
- Choose movie/series
- If it is a series, you are prompted to choose season number ** Note: For Series, you are limited to 300 episodes per season
- Based on data available, create a page in your Notion Database
- Press ^C inorder to quit
| Series Page | Movie Page |
|---|---|
![]() |
![]() |
See Pyinstaller documentation: Getting start
Mac: pyinstaller --onefile --add-data ".env:." main2.py
Windows: pyinstaller --onefile --add-data ".env;." main2.py
- Bundle main.py using pyinstaller as seen above.
- main2.exe is created under dist folder. Copy it into the current directory and delete both the dist and build folders.
- Execute ./main2 in your current directory to check whether it is working
cp main2 ~/bin(considering the fact that you already made a bin directory in your root ~) You might need to modify .zshrc or .bashrc to include a PATH to the bin- You now have a global executable! :D
Credits: load-dotenv-not-working-when-running-pyinstaller A simple work around is to make sure we have an absolute path that points to the .env file.
base_path = os.path.dirname(os.path.abspath(__file__))
env_path = os.path.join(base_path, '.env')
load_dotenv(env_path)

