Metadata-Version: 2.4
Name: notion-sdk-ldraney
Version: 0.2.4
Summary: Python SDK for the Notion API v2025-09-03
Author: Lucas Draney
License: MIT
Project-URL: Repository, https://github.com/ldraney/notion-sdk
Project-URL: Issues, https://github.com/ldraney/notion-sdk/issues
Keywords: notion,api,sdk,python
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Intended Audience :: Developers
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.27
Requires-Dist: python-dotenv>=1.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: ruff>=0.4.0; extra == "dev"
Dynamic: license-file

[![PyPI](https://img.shields.io/pypi/v/notion-sdk-ldraney)](https://pypi.org/project/notion-sdk-ldraney/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)

# 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

```bash
pip install notion-sdk-ldraney
```

## Usage

```python
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

```bash
# Set your Notion API key
export NOTION_API_KEY=secret_...

# Run integration tests
pytest tests/ -v
```
