Skip to content

ultimate-notion/ultimate-notion

Repository files navigation

Ultimate-Notion logo

Ultimate Notion is the ultimate Python client for Notion! It allows you to access, create and change your Notion databases and pages in the most convenient and pythonic way.

CI/CD Tests Coverage Publish Package Build Docs
Package PyPI - Version PyPI - Downloads PyPI - Python Version GitHub Sponsors
Details Hatch project Linting - Ruff Pre-Commit test - pytest Types - Mypy License - MIT Docs - mkdocs

✨ Features

  • πŸ—‚οΈ CRUD operations β€” Create, read, update, and delete Notion pages and databases.
  • 🐍 Pythonic API β€” Clean, intuitive interfaces that feel natural in Python.
  • πŸ”’ Token-based authentication β€” Secure access using Notion integration tokens.
  • πŸ”Ž Rich querying capabilities β€” Support for filters, sorting, pagination, and searching.
  • 🧩 Integration with notion-sdk-py β€” Built atop the official client, enhancing functionality.
  • πŸš€ One-step setup β€” Getting up to speed with a simple setup guide.

πŸ‘‰ Want to learn more? Check out the full feature breakdown.

πŸ“¦ Installation

Install the most recent release using PyPI with:

pip install ultimate-notion

or to install all additional dependencies, use:

pip install 'ultimate-notion[all]'

πŸ§ͺ Installing the Development Version

To install the latest (potentially unstable) version directly from the main branch on GitHub:

pip install git+https://github.com/ultimate-notion/ultimate-notion.git@main

or with all optional dependencies:

pip install 'ultimate-notion[all] @ git+https://github.com/ultimate-notion/ultimate-notion.git@main'

πŸš€ Usage

Make sure you have set the environment variable NOTION_TOKEN to your Notion integration token. Then it's as simple as:

import ultimate_notion as uno

PAGE_TITLE = 'Getting Started'

with uno.Session() as notion:
    page = notion.search_page(PAGE_TITLE).item()
    page.show()

# Alternatively, without a context manager:
notion = uno.Session()
page = notion.search_page(PAGE_TITLE).item()
page.show()
notion.close()

Check out the official Ultimate Notion documentation for more details. Especially the page about creating a Notion integration to get the token.

πŸ’¬ Getting help

If you are stuck with a problem and need help or just want to brag about what you did, the Discussion area is the right place for you. Here, you can ask questions, provide suggesions and discuss with other users.

🀝 Contributing

After having cloned this repository:

  1. make sure hatch is installed globally, e.g. pipx install hatch,
  2. make sure pre-commit is installed globally, e.g. with pipx install pre-commit,

and then you are already set up to start hacking. Use hatch run test to run the unit tests or hatch run vcr-only to run the offline unit tests using VCR.py. Regenerate the cassettes with hatch run vcr-rewrite. Check out the environment setup of hatch in pyproject.toml for many more commands.

If you are using VS Code, it's quite convenient to create a file .vscode/.env with

NOTION_TOKEN=TOKEN_TO_YOUR_TEST_NOTION_ACCOUNT
ULTIMATE_NOTION_CONFIG=/path/to/repo/.ultimate-notion/config.toml

Check out this page about contributing for more details.

πŸ“„ License & Credits

Ultimate Notion is distributed under the terms of the MIT license. Ultimate Notion is built on top of notion-sdk-py. To start this project off a lot of inspiration and code was taken from notional and the overall project setup from hatch. The documentation is made with Material for MkDocs and is hosted on GitHub Pages.

About

πŸš€ The ultimate Python client for Notion!

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Contributors 5