Skip to main content

The ultimate Python library for Notion!

Project description

Ultimate-Notion logo

Ultimate Notion is the ultimate Python library for Notion 🚀 It allows you to access and modify 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
Details Hatch project linting - Ruff Types - Mypy License - MIT GitHub Sponsors

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]

Usage

import ultimate_notion as uno

TOKEN = "secret_YOUR_TOKEN_HERE"
# Change PAGE_TITLE to the title of your page
PAGE_TITLE = "Getting Started"

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

# Alternatively, without a context manager:
notion = uno.Session.get_or_create(auth=TOKEN)
# `auth` can be omitted if `NOTION_TOKEN` is set in the environment, i.e.
# notion = uno.Session.get_or_create()
# which also works for the context manager
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. The documentation is made with Material for MkDocs and is hosted on GitHub Pages.

Contributing

After having cloned this repository:

  1. make sure hatch in installed globally, e.g. pipx install hatch,
  2. make sure pre-commit is installed globally, e.g. with pipx install pre-commit,
  3. optionally run hatch config set dirs.env.virtual .direnv to let VS Code find your virtual environments,

and then you are already set up to start hacking. Use hatch run cov or hatch run no-cov to run the unitest with or without coverage reports, respectively. Check out the environment setup of hatch in pyproject.toml for many more commands.

If you are using VS Code, then it's quite convenient to add a file .env in your checkout with:

[pytest]
env =
    NOTION_AUTH_TOKEN=secret_YOUR_TOKEN_TO_YOUR_TEST_NOTION_ACCOUNT

Check out this page about contributing for more details.

License & Credits

Ultimate Notion is distributed under the terms of the MIT license. To start this project off a lot of inspiration and code was taken from hatch and notional. Ultimate Notion highly depends on notion-sdk-py.

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

ultimate_notion-0.1.tar.gz (50.7 kB view details)

Uploaded Source

Built Distribution

ultimate_notion-0.1-py3-none-any.whl (60.6 kB view details)

Uploaded Python 3

File details

Details for the file ultimate_notion-0.1.tar.gz.

File metadata

  • Download URL: ultimate_notion-0.1.tar.gz
  • Upload date:
  • Size: 50.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for ultimate_notion-0.1.tar.gz
Algorithm Hash digest
SHA256 1b418e6e287e0040c3990f306f5dba511409b1fb903a45aaa094758282fb8335
MD5 cc4baa4c08c473c83a86cbf96fa3ee34
BLAKE2b-256 d10dcd2dd6b43c528c81e020261e21fcb3a783765e0380d5e75f2197038aa809

See more details on using hashes here.

File details

Details for the file ultimate_notion-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ultimate_notion-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8b4ff658a63b59575d24a298a2c60be75fc531ec7c0ec9c57f84e18ec269d02d
MD5 bbad0de3b640afd4b41b4d4748cc1081
BLAKE2b-256 b43a373e2e92d0ea091278157d2b54927bc78b067f5e7ac89445c60fab3a2c50

See more details on using hashes here.

Supported by

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