https://github.com/thunderbird/notion-scripts
https://github.com/thunderbird/notion-scripts
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/thunderbird/notion-scripts
- Owner: thunderbird
- License: mpl-2.0
- Created: 2024-06-18T18:30:23.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-28T18:27:25.000Z (about 1 year ago)
- Last Synced: 2025-04-28T19:31:29.538Z (about 1 year ago)
- Language: Python
- Size: 39.1 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# notion-scripts
## How to set up a syncing database:
1. Create a new database in Notion, and set the Status property. This is manual because the API doesn't support adding or modifying the Status property on a database.
2. Attach the `MZLA Integrations` app under `Connections` in the ... menu, otherwise the script won't be able to access the database.
3. Get the database id from the URL. It's the string after `/mzthunderbird/` not including the query params.
4. Create a new file similar to the existing `bz_notion_sync.py` and write the API integration logic.
Currently, a Bugzilla API key, GitHub API key, and the Notion integration secret for MZLA Integrations are required to run this script.
## Overview
`libs/notion_data.py` contains classes and utilities for adding and updating Notion database pages and properties.
This contains two main classes:
* `NotionDatabase`: Defines a Notion database, along wih its properties and a remotely tied Notion client used for CRUD operations.
* `NotionProperty`: Defines a generic Notion property, including functions to return the right data for updating content and the property itself.
### Bugzilla Sync
* `libs/bzhelper.py` contains helper functions and utilities for connecting to Bugzilla and syncing Bugzilla -> Notion.
* `bzsettings.py` contains Notion database properties and bugzilla fields that are used by sync process.
* `bz_notion_sync.py` is used to run the sync code.
### GitHub Issues Sync
* `libs/ghhelper.py` contains helper functions and utilities for connecting to GitHub and syncing to Notion.
* `ghsettings.py` contains the repo list, db properties and other basic settings.
* `gh_notion_sync.py` is used to run the sync code.