Sync Obsidian notes to Notion via GitHub
Project description
Obsidian Notion Sync
A tool to sync Obsidian notes to Notion via GitHub.
Installation
pip install obsidian-notion-sync
Usage
Configuration
Before using the tool, you need to set up the following environment variables:
Variable | Description | Example |
---|---|---|
GITHUB_TOKEN | Your GitHub personal access token | ghp_1234... |
NOTION_TOKEN | Your Notion integration token | secret_5678... |
OBSIDIAN_DIR | Path to your Obsidian vault | /Users/you/ObsidianVault |
REPO_NAME | Name for the GitHub repository | My-Second-Brain |
NOTION_DATABASE_ID | ID of your Notion database | abc123... |
Setting up tokens
-
GitHub Token:
- Go to GitHub Settings → Developer Settings → Personal Access Tokens
- Create a new token with 'repo' permissions
-
Notion Token:
- Go to www.notion.so/my-integrations
- Create a new integration
- Copy the integration token
-
Notion Database ID:
- Create a new database in Notion
- Copy the database ID from the URL (it's the part after the workspace name and before the '?')
Usage
Basic sync:
obsidian-notion-sync
Enable debug logging:
obsidian-notion-sync --debug
View help:
obsidian-notion-sync --help
Example Configuration Script
You can create a shell script to set up your environment:
#!/bin/bash
export GITHUB_TOKEN="your_github_token"
export NOTION_TOKEN="your_notion_token"
export OBSIDIAN_DIR="/path/to/your/obsidian/vault"
export REPO_NAME="your-repo-name"
export NOTION_DATABASE_ID="your_database_id"
obsidian-notion-sync --debug
Save this as run-sync.sh
, make it executable (chmod +x run-sync.sh
), and run it with ./run-sync.sh
.
Troubleshooting
If you encounter errors:
-
Check that all environment variables are set correctly:
echo $GITHUB_TOKEN echo $NOTION_TOKEN echo $OBSIDIAN_DIR echo $REPO_NAME echo $NOTION_DATABASE_ID
-
Ensure your Obsidian vault path exists and is accessible
-
Verify that your GitHub token has the necessary permissions
-
Check that your Notion integration is properly configured and has access to the database
Support
If you encounter any issues, please file them on our GitHub repository's issue tracker.
License
obisidian-notion-sync
is distributed under the terms of the MIT license.
Directory structure:
# obsidian_notion_sync/
# ├── .github/
# │ └── workflows/
# │ └── publish.yml
# ├── src/
# │ └── obsidian_notion_sync/
# │ ├── __init__.py
# │ ├── cli.py
# │ ├── config.py
# │ ├── sync.py
# │ ├── github_manager.py
# │ ├── git_manager.py
# │ └── exceptions.py
# ├── tests/
# │ └── __init__.py
# ├── .gitignore
# ├── LICENSE
# ├── README.md
# ├── pyproject.toml
# └── setup.cfg
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file obsidian_notion_sync-0.1.tar.gz
.
File metadata
- Download URL: obsidian_notion_sync-0.1.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.27.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07905de7a47fb982a35901395aab43ccca832c296e84c96048918130f069a46f |
|
MD5 | 251c6e49295446dd9003e6125c0a6932 |
|
BLAKE2b-256 | 94a7ac463a6a98f4710e2466a09231f6d87542d0e1b5a0ab68e1ce6570be1c2f |
File details
Details for the file obsidian_notion_sync-0.1-py3-none-any.whl
.
File metadata
- Download URL: obsidian_notion_sync-0.1-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.27.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2f8c002872d62178df402d4b3409657f9301e71d0e2366b0566b3e8cd600bf1 |
|
MD5 | 76a01e0292d475958380c5b0a71cfa5d |
|
BLAKE2b-256 | 21f5f15137d2ab64584e09fd2f9258cbfb9062a5e8c13c72c82c1640058a541e |