Local-first sync for Notion: work with pages as markdown files
Project description
Local-first sync for Notion. Work with pages as markdown files.
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:
NOTION_TOKENenvironment variable~/.notionfs/config.tomlfile
# 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
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51447bce357efeda2d1706ed25e492958f57fbcfe8ea78cd8ac124f8411cd12f
|
|
| MD5 |
671889bedfde8545047ebe3783a14609
|
|
| BLAKE2b-256 |
3be2d781f047b93e3e10f36ed183f388c869f8750875d5f147147548569748f7
|
Provenance
The following attestation bundles were made for notionfs-0.3.0.tar.gz:
Publisher:
publish.yml on can1357/notionfs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
notionfs-0.3.0.tar.gz -
Subject digest:
51447bce357efeda2d1706ed25e492958f57fbcfe8ea78cd8ac124f8411cd12f - Sigstore transparency entry: 786573624
- Sigstore integration time:
-
Permalink:
can1357/notionfs@b3dd19a6c2f593241f05bf5aef68f81d11e910a0 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/can1357
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b3dd19a6c2f593241f05bf5aef68f81d11e910a0 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f270a727712693ea71cd324f4b384f9b23317a0abde0ef32f7bcb3020b90613
|
|
| MD5 |
00b19b9c7214e3b6b175d67d6d0dcef5
|
|
| BLAKE2b-256 |
90428aeff3ab2013b5155b544daf800fb7b530d9fdb12727a0150076d61d7a9b
|
Provenance
The following attestation bundles were made for notionfs-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on can1357/notionfs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
notionfs-0.3.0-py3-none-any.whl -
Subject digest:
1f270a727712693ea71cd324f4b384f9b23317a0abde0ef32f7bcb3020b90613 - Sigstore transparency entry: 786573626
- Sigstore integration time:
-
Permalink:
can1357/notionfs@b3dd19a6c2f593241f05bf5aef68f81d11e910a0 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/can1357
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b3dd19a6c2f593241f05bf5aef68f81d11e910a0 -
Trigger Event:
push
-
Statement type: