Skip to main content

Local-first sync for Notion: work with pages as markdown files

Project description

NotionFS

Local-first sync for Notion. Work with pages as markdown files.

PyPI version CI License


Features

Feature Description
Bidirectional Sync Push local changes to Notion, pull remote changes down
Markdown Native Edit pages as .md files with full formatting support
Frontmatter Properties Database properties sync via YAML frontmatter
Conflict Detection Smart detection with multiple resolution strategies
Watch Mode Continuous sync with file watching and remote polling
Offline First Work without internet, sync when ready

Installation

pip install notionfs

Quick Start

# Set your Notion API token
export NOTION_TOKEN="secret_..."

# Initialize a workspace (interactive page selection)
notionfs clone

# Or from a URL directly
notionfs clone https://www.notion.so/My-Page-abc123...

# Sync your changes
notionfs pull    # Download from Notion
notionfs push    # Upload to Notion
notionfs sync    # Bidirectional sync

Commands

Command Description
notionfs clone [URL] Clone a Notion page or database to local workspace
notionfs pull Download remote changes from Notion
notionfs push Upload local changes to Notion
notionfs sync Bidirectional sync (pull then push)
notionfs status Show pending changes and conflicts
notionfs watch Continuous sync with file watching
notionfs resolve <file> Resolve sync conflicts
notionfs auth [token] Manage Notion API token
notionfs list List initialized workspaces

Workspace Structure

my-workspace/
├── .notionfs/
│   ├── config.toml       # Workspace config
│   └── state.db          # Sync state
├── Page Title.md         # Leaf page
├── Parent Page/          # Page with children -> directory
│   ├── _index.md         # Parent page content
│   └── Child Page.md
└── Database Name/        # Database -> directory
    ├── Entry 1.md
    └── Entry 2.md

Markdown Format

Pages are markdown with YAML frontmatter for database properties:

---
Status: In Progress
Tags:
  - work
  - important
Due Date: 2024-03-15
---

# Meeting Notes

Your content here.

- Bullet points
- [ ] Todo items
- [x] Completed items

> Quotes work too

Conflict Resolution

# Check for conflicts
notionfs status

# Resolve conflicts
notionfs resolve "Page.md" --keep-local   # Your version wins
notionfs resolve "Page.md" --keep-remote  # Notion version wins
notionfs resolve "Page.md" --keep-both    # Keep both versions

Watch Mode

# Continuous sync (2s local debounce, 30s remote poll)
notionfs watch

# Custom intervals
notionfs watch -d 1 -i 60    # 1s debounce, 60s poll

Configuration

Token lookup order:

  1. NOTION_TOKEN environment variable
  2. ~/.notionfs/config.toml file
# Save token permanently
notionfs auth secret_...

Tips & Tricks

# Search across all notes
grep -r "TODO" .

# Batch edit
find . -name "*.md" -exec sed -i 's/old/new/g' {} \;
notionfs push

# Git integration (version history for your notes)
git init && echo ".notionfs/" >> .gitignore

Troubleshooting

# Debug mode
notionfs --debug pull
notionfs --debug push

# Page not accessible?
# -> Add your integration via page menu -> Connections

License

MIT

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

notionfs-0.4.0.tar.gz (183.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

notionfs-0.4.0-py3-none-any.whl (61.5 kB view details)

Uploaded Python 3

File details

Details for the file notionfs-0.4.0.tar.gz.

File metadata

  • Download URL: notionfs-0.4.0.tar.gz
  • Upload date:
  • Size: 183.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for notionfs-0.4.0.tar.gz
Algorithm Hash digest
SHA256 cff727fd0056052682b64fdbad01d2fda9be639dc4caab8d90be087f7210ebae
MD5 ed4a9be3953b14af402d978d19cb63b9
BLAKE2b-256 05c6de77794bd3f264b56c19cd3f1891ea335198ad9475210bc273bf2955cae0

See more details on using hashes here.

Provenance

The following attestation bundles were made for notionfs-0.4.0.tar.gz:

Publisher: publish.yml on can1357/notionfs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file notionfs-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: notionfs-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 61.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for notionfs-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d6c675d55e8386db4249f5b5302967b26339229aa5200eb0264d54d44036ade
MD5 942316c9314789097a99f5ffab9da4d0
BLAKE2b-256 c62e13221f1b35c7c03202a4d9887df3ed631c2591bf50dfda9ac847e4ca31bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for notionfs-0.4.0-py3-none-any.whl:

Publisher: publish.yml on can1357/notionfs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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