The ultimate Python client for Notion!
Project description
Ultimate Notion is the ultimate Python client for Notion 🚀 It allows you to access and modify your Notion databases and pages in the most convenient and pythonic way.
CI/CD | |
Package | |
Details |
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:
- make sure hatch in installed globally, e.g.
pipx install hatch
, - make sure pre-commit is installed globally, e.g. with
pipx install pre-commit
, - 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 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, 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
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
File details
Details for the file ultimate_notion-0.3.tar.gz
.
File metadata
- Download URL: ultimate_notion-0.3.tar.gz
- Upload date:
- Size: 52.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac7da0792986c16e7b09c7a2e41aa9c4d474c4d599d3884c0577d0a1c499e872 |
|
MD5 | 7aea9fae5490b7ce949ac806184565dc |
|
BLAKE2b-256 | 50803d3b9d601036b0ac48fd01d21852a264d4837f8f21b18eee8da3cf6d8dfa |
File details
Details for the file ultimate_notion-0.3-py3-none-any.whl
.
File metadata
- Download URL: ultimate_notion-0.3-py3-none-any.whl
- Upload date:
- Size: 62.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f0b2d5f114baae15e8a6da21e8154a4aa38508e629fb5a98ff9f267272947a1 |
|
MD5 | 37579f1ca9f0d5164c6df162bba69c8c |
|
BLAKE2b-256 | 2b3fda5b740a709e74aa1869ba0d646ff30c53c9f2d18ade803ed829a9eb7eff |