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.

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.1.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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

Hashes for obsidian_notion_sync-0.1.tar.gz
Algorithm Hash digest
SHA256 07905de7a47fb982a35901395aab43ccca832c296e84c96048918130f069a46f
MD5 251c6e49295446dd9003e6125c0a6932
BLAKE2b-256 94a7ac463a6a98f4710e2466a09231f6d87542d0e1b5a0ab68e1ce6570be1c2f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for obsidian_notion_sync-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e2f8c002872d62178df402d4b3409657f9301e71d0e2366b0566b3e8cd600bf1
MD5 76a01e0292d475958380c5b0a71cfa5d
BLAKE2b-256 21f5f15137d2ab64584e09fd2f9258cbfb9062a5e8c13c72c82c1640058a541e

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