Skip to main content

PyPI License: MIT Python 3.10+

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

Metadata

Release files for notion-sdk-ldraney 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for notion-sdk-ldraney 0.2.4
File Size Uploaded
notion_sdk_ldraney-0.2.4.tar.gz 12.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for notion-sdk-ldraney 0.2.4
File Interpreter ABI Platform
notion_sdk_ldraney-0.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 22.8 kB

Release files / notion_sdk_ldraney-0.2.4.tar.gz

Download URL notion_sdk_ldraney-0.2.4.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7dd06b43b33b733676a74ecea3b051c7ecaf2d1c542939eb1b46cb3c7868640a
BLAKE2b-256 checksum
How to use checksums
af8ae51b47ec211d38837c5a92ac405d23a8bd7803689a98214342581f75975c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / notion_sdk_ldraney-0.2.4-py3-none-any.whl

Download URL notion_sdk_ldraney-0.2.4-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
135d57a5f0f845ed15ea1388286479864c16a4b139b90cd271a7b6007c2f3564
BLAKE2b-256 checksum
How to use checksums
271b3b7950fab975eceed0ac1fa7feb5e3cb19a6fd95a48d1b8d1b586d83d69b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release history Release notifications | RSS feed

This release

0.2.4 This release

2 release files

0.2.3

2 release files

0.2.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page