Python SDK for the Notion API v2025-09-03
Project description
notion-sdk
Python SDK for the Notion API. Thin wrapper with 1:1 endpoint mapping, proven with pytest integration tests.
Why
The official Notion MCP integration silently drops properties on database creation/update. This SDK correctly uses initial_data_source.properties and is validated against the live API.
Install
pip install notion-sdk-ldraney
Usage
from notion_sdk import NotionClient
client = NotionClient(api_key="secret_...")
# Create a database with properties that actually work
db = client.create_database(
parent={"type": "page_id", "page_id": "..."},
title=[{"text": {"content": "My DB"}}],
initial_data_source={
"properties": {
"Name": {"type": "title", "title": {}},
"Status": {"type": "select", "select": {
"options": [{"name": "Done", "color": "green"}]
}}
}
}
)
API Coverage
- Search: search
- Pages: create (with template support), get, update (with erase_content), archive, move
- Databases: create (with properties!), get, update, query, archive
- Data Sources: get, update, query, list templates
- Blocks: get, get children, append children, update, delete
- Users: list, get self
- Comments: create, list
Testing
# Set your Notion API key
export NOTION_API_KEY=secret_...
# Run integration tests
pytest tests/ -v
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 notion_sdk_ldraney-0.2.3.tar.gz.
File metadata
- Download URL: notion_sdk_ldraney-0.2.3.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5119db65359b4d545f707bd0148b649c8f0b4d42495f1b88d983ecbfd3f6fdf2
|
|
| MD5 |
7679800ca04adeae7d0692ff43bd67ef
|
|
| BLAKE2b-256 |
2ba34c6a86cf97facff080ad973b1ac3cfff5532399331509ee9d9357cdc2692
|
Provenance
The following attestation bundles were made for notion_sdk_ldraney-0.2.3.tar.gz:
Publisher:
publish.yml on ldraney/notion-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
notion_sdk_ldraney-0.2.3.tar.gz -
Subject digest:
5119db65359b4d545f707bd0148b649c8f0b4d42495f1b88d983ecbfd3f6fdf2 - Sigstore transparency entry: 955126315
- Sigstore integration time:
-
Permalink:
ldraney/notion-sdk@cb2f6fc43046b730f43422be41afbd4b2cfc1e38 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ldraney
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cb2f6fc43046b730f43422be41afbd4b2cfc1e38 -
Trigger Event:
push
-
Statement type:
File details
Details for the file notion_sdk_ldraney-0.2.3-py3-none-any.whl.
File metadata
- Download URL: notion_sdk_ldraney-0.2.3-py3-none-any.whl
- Upload date:
- Size: 10.1 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 |
e55a840a06287682a2c25322afbdd8e2f5a0fea500706d4e69caf0905d6483e1
|
|
| MD5 |
8d9d809c5a47c2c369bfc41526b5ba0d
|
|
| BLAKE2b-256 |
7c2f4cb9e4a0df91739afa579304d6f5e24295048352b425c64b6668c523e08c
|
Provenance
The following attestation bundles were made for notion_sdk_ldraney-0.2.3-py3-none-any.whl:
Publisher:
publish.yml on ldraney/notion-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
notion_sdk_ldraney-0.2.3-py3-none-any.whl -
Subject digest:
e55a840a06287682a2c25322afbdd8e2f5a0fea500706d4e69caf0905d6483e1 - Sigstore transparency entry: 955126323
- Sigstore integration time:
-
Permalink:
ldraney/notion-sdk@cb2f6fc43046b730f43422be41afbd4b2cfc1e38 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ldraney
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cb2f6fc43046b730f43422be41afbd4b2cfc1e38 -
Trigger Event:
push
-
Statement type: