Skip to main content

Sync Obsidian notes to Notion via GitHub

Project description

Obsidian Notion Sync

A tool to sync Obsidian notes to Notion via GitHub.

Diagram

Installation

pip install obsidian-notion-sync

PyPI - Version PyPI - Python Version

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

  1. GitHub Token:

    • Go to GitHub Settings → Developer Settings → Personal Access Tokens
    • Create a new token with 'repo' permissions
  2. Notion Token:

  3. 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:

  1. Check that all environment variables are set correctly:

    echo $GITHUB_TOKEN
    echo $NOTION_TOKEN
    echo $OBSIDIAN_DIR
    echo $REPO_NAME
    echo $NOTION_DATABASE_ID
    
  2. Ensure your Obsidian vault path exists and is accessible

  3. Verify that your GitHub token has the necessary permissions

  4. 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

obsidian_notion_sync-0.2.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

obsidian_notion_sync-0.2-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file obsidian_notion_sync-0.2.tar.gz.

File metadata

  • Download URL: obsidian_notion_sync-0.2.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.2

File hashes

Hashes for obsidian_notion_sync-0.2.tar.gz
Algorithm Hash digest
SHA256 02ca2d57d688079cf0e0bdf07cf0a62778f1787cd40ec03bf196287916fa4734
MD5 a91fe0e5de3db7cba701e7e49dfaab48
BLAKE2b-256 28b4221a6c62eecc493dfe76f90fbb34668b43a701c46910d840ec05acc43d46

See more details on using hashes here.

File details

Details for the file obsidian_notion_sync-0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for obsidian_notion_sync-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 283e495dec5eef3f483f01c590c0e4aeb0110c168a279e9f33ecb49ca1e7c1e1
MD5 ac80f16712a638d99acf0de83700b143
BLAKE2b-256 abf954747c6b61c7a8428ba0e0c408552582f22ea684a2bf20a5171f7f5460e3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page