https://github.com/blairnangle/notion-to-todoist
Python 3 script to migrate to-do lists in Notion to tasks in Todoist.
https://github.com/blairnangle/notion-to-todoist
Last synced: 2 months ago
JSON representation
Python 3 script to migrate to-do lists in Notion to tasks in Todoist.
- Host: GitHub
- URL: https://github.com/blairnangle/notion-to-todoist
- Owner: blairnangle
- License: mit
- Created: 2020-03-29T13:53:39.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-22T23:22:32.000Z (almost 2 years ago)
- Last Synced: 2025-01-25T11:41:55.620Z (4 months ago)
- Language: Python
- Homepage:
- Size: 190 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Notion to Todoist
Python 3 script to migrate to-do lists in Notion to tasks in Todoist.
Makes use of the unofficial [notion-py library](https://github.com/jamalex/notion-py) and official
[Todoist REST API](https://developer.todoist.com/rest/v1/).## Prerequisites
* [Python 3](https://www.python.org/downloads/)
* [pip](https://pypi.org/project/pip/) (included by default with Python versions >= 3.4)
* [venv](https://docs.python.org/3/library/venv.html) (included by default with Python versions >= 3.3)## Installation
* Create a virtual environment:
```bash
$ python3 -m venv .venv
```
* Activate the virtual environment:```bash
$ source .venv/bin/activate
```* Install requirements:
```bash
$ pip install -r requirements.txt
```## Usage
### Obtaining API Keys
#### Notion
Until Notion releases a public API, the (hacky) way to get an API token is to sign into Notion on a web browser and
copy the authentication cookie. For example, using Chrome's DevTools:
#### Todoist
Sign into Todoist (browser or native application), navigate to Settings > Integrations and scroll to the bottom:

### Configuring
Your `config.yml` file should look similar to:
```yaml
# Notion-specific config
notion:
user: "blairnangle"
api_token: "the token you grabbed from your browser"# Todoist-specific config
todoist:
api_token: "the token you grabbed from Settings > Integrations"# Configure migration of a to-do list on a Notion page to tasks in a Todoist project
migration:
- notion: "Reading-List-2657c435b8654900a1f14850aca28daa"
todoist: "Reading List"
- notion: "Shopping-List-24a61811037742894c3a395f9d72ddae"
todoist: "Shopping List"
```Notion pages must consist entirely of "To-do list" blocks.
If a project does not already exist for a Todoist project, it will be created.
### Running
To run the script (the virtual environment needs to have been activated using [above instructions](#installation)):
```bash
$ ./execute.py
```## License
Distributed under [MIT License](./LICENSE).