https://github.com/harlanheilman/notion-notebook
Keep your computational work documented. Auto-syncs Jupyter notebooks to Notion.
https://github.com/harlanheilman/notion-notebook
automation documentation jupyter notion
Last synced: 2 months ago
JSON representation
Keep your computational work documented. Auto-syncs Jupyter notebooks to Notion.
- Host: GitHub
- URL: https://github.com/harlanheilman/notion-notebook
- Owner: HarlanHeilman
- Created: 2026-04-05T03:51:42.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-04-05T05:57:40.000Z (3 months ago)
- Last Synced: 2026-04-05T07:52:01.708Z (3 months ago)
- Topics: automation, documentation, jupyter, notion
- Language: Jupyter Notebook
- Homepage: https://github.com/HarlanHeilman/notion-notebook
- Size: 366 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Agents: AGENTS.md
Awesome Lists containing this project
README
# notion-notebook
Export Jupyter notebooks to a Notion page on save: structured cells, image uploads, optional inline **Figures** table (append-only plot history per sync), and git-aware metadata.
## Install
```bash
uv sync
```
## Configure
Set environment variables or `~/.notion_matplotlib/config.json` (see `notion_notebook.config.Config`):
- `NOTION_TOKEN` — integration secret
- `NOTION_PAGE_ID` — target page id or URL fragment
## Use in a notebook
```python
from notion_notebook import NotebookExporter
exporter = NotebookExporter(
notion_token="ntn_...",
notion_page_id="your-page-id-or-url",
notebook_path="/absolute/path/to/notebook.ipynb", # optional if ipynbname can resolve
)
exporter.start()
```
Call `exporter.manual_sync()` for an immediate run, or `exporter.stop()` to tear down the file watcher.
## CLI
The `notion-notebook` console script prints a short usage hint; primary use is the Python API in notebooks.
## Development
```bash
uv run pytest
uv run ty check
uv run ruff check src/ tests/
```
After editing notebook Python in this repo, use `uv run ty check` and `uv run ruff check notebooks/` as well when those files change.