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.3.0.tar.gz (183.3 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.3.0-py3-none-any.whl (61.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for notionfs-0.3.0.tar.gz
Algorithm Hash digest
SHA256 51447bce357efeda2d1706ed25e492958f57fbcfe8ea78cd8ac124f8411cd12f
MD5 671889bedfde8545047ebe3783a14609
BLAKE2b-256 3be2d781f047b93e3e10f36ed183f388c869f8750875d5f147147548569748f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for notionfs-0.3.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.3.0-py3-none-any.whl.

File metadata

  • Download URL: notionfs-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 61.2 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f270a727712693ea71cd324f4b384f9b23317a0abde0ef32f7bcb3020b90613
MD5 00b19b9c7214e3b6b175d67d6d0dcef5
BLAKE2b-256 90428aeff3ab2013b5155b544daf800fb7b530d9fdb12727a0150076d61d7a9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for notionfs-0.3.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