{"id":13907789,"url":"https://github.com/getsyncr/notion-sdk","last_synced_at":"2025-10-27T12:21:28.312Z","repository":{"id":45147151,"uuid":"387524789","full_name":"getsyncr/notion-sdk","owner":"getsyncr","description":"A simple and easy to use Python client for the Notion API","archived":false,"fork":false,"pushed_at":"2023-04-24T05:14:00.000Z","size":681,"stargazers_count":27,"open_issues_count":4,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-27T21:03:31.602Z","etag":null,"topics":["api","async","client","httpx","notion","pydantic","python","sdk","sync"],"latest_commit_sha":null,"homepage":"https://getsyncr.github.io/notion-sdk","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/getsyncr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-19T16:15:32.000Z","updated_at":"2025-02-25T02:27:47.000Z","dependencies_parsed_at":"2024-11-25T16:35:01.244Z","dependency_job_id":"a122c64d-09a1-46f5-bb0a-7353214e5dee","html_url":"https://github.com/getsyncr/notion-sdk","commit_stats":{"total_commits":47,"total_committers":2,"mean_commits":23.5,"dds":0.04255319148936165,"last_synced_commit":"cf1f8ac35d61beef87af5213dd32d5c19ca096b7"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/getsyncr/notion-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getsyncr%2Fnotion-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getsyncr%2Fnotion-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getsyncr%2Fnotion-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getsyncr%2Fnotion-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getsyncr","download_url":"https://codeload.github.com/getsyncr/notion-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getsyncr%2Fnotion-sdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265710543,"owners_count":23815375,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","async","client","httpx","notion","pydantic","python","sdk","sync"],"created_at":"2024-08-06T23:02:10.568Z","updated_at":"2025-10-27T12:21:28.244Z","avatar_url":"https://github.com/getsyncr.png","language":"Python","readme":"\u003cp align=\"center\"\u003e\n    \u003cdiv align=\"center\"\u003e\n        \u003ch1\u003eNotion SDK for Python\u003c/h1\u003e\n        \u003cp\u003e\n            \u003cb\u003eA simple and easy to use Python client for the \u003ca href=\"https://developers.notion.com\"\u003eNotion API\u003c/a\u003e \u003c/b\u003e\n        \u003c/p\u003e\n        \u003ca href=\"https://pypi.org/project/notion-sdk/\"\u003e\u003cimg src=\"https://badge.fury.io/py/notion-sdk.svg\" alt=\"PyPI version\" height=\"18\"\u003e\u003c/a\u003e\n        \u003ca href=\"https://github.com/getsyncr/notion-sdk/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-Apache%202.0-blue.svg\" alt=\"License\" height=\"18\"\u003e\u003c/a\u003e\n        \u003ca href=\"https://pepy.tech/project/notion-sdk\"\u003e\u003cimg alt=\"Downloads\" src=\"https://pepy.tech/badge/notion-sdk\"\u003e\u003c/a\u003e\n        \u003ca href=\"https://github.com/psf/black\"\u003e\u003cimg alt=\"Code style: black\" src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"\u003e\u003c/a\u003e\n    \u003c/div\u003e\n\u003c/p\u003e\n\n`Notion SDK` is a fully typed Python library to use the Notion API. It supports asyncio.\nIt uses the great [httpx](https://github.com/encode/httpx) as an HTTP client and [pydantic](https://github.com/samuelcolvin/pydantic)\nfor data validation and typing. This client is meant to be a Python version of the reference [JavaScript SDK](https://github.com/makenotion/notion-sdk-js), so usage should be pretty similar between both.\n\n## Installation\n\n```shell\n$ pip install notion-sdk\n```\n\n## Usage\n\nImport and initialize a client using an **integration token** or an OAuth **access token**.\n\n```python\nfrom notion import NotionClient\n\nnotion = NotionClient(auth=\"YOUR_ACCESS_TOKEN\")\n\ndef fetch_databases() -\u003e None:\n    response = notion.databases.list()\n    for database in response.results:\n        print(database.title)\n\nif __name__ == \"__main__\":\n    fetch_databases()\n```\n\nMore example are available in the [examples](examples) folder.\n\n## Async Usage\n\nThis library supports asynchronous calls to Notion API.\n\nEach method returns a `Coroutine` that have to be awaited to retreive the typed response.\n\nThe same methods are available for sync or async but you have to use the `NotionAsyncClient` like\nin the following example:\n\n```python\nimport asyncio\n\nfrom notion import NotionAsyncClient\n\nnotion = NotionAsyncClient(auth=\"YOUR_ACCESS_TOKEN\")\n\nasync def fetch_databases() -\u003e None:\n    response = await notion.databases.list()\n    for database in response.results:\n        print(database.title)\n\nif __name__ == \"__main__\":\n    asyncio.run(fetch_databases())\n```\n\n## Clients options\n\n`NotionClient` and `NotionAsyncClient` support the following options on initialization.\nThese options are all keys in the single constructor parameter.\n\n\u003c!-- markdownlint-disable --\u003e\n| Option | Default value | Type | Description |\n|--------|---------------|---------|-------------|\n| `auth` | `None` | `string` | Bearer token for authentication. If left undefined, the `auth` parameter should be set on each request. |\n| `timeout` | `60` | `int` | Number of seconds to wait before emitting a `RequestTimeoutError` |\n| `base_url` | `\"https://api.notion.com/v1/\"` | `string` | The root URL for sending API requests. This can be changed to test with a mock server. |\n| `user_agent` | `notion-sdk/VERSION (https://github.com/getsyncr/notion-sdk)` | `string` | A custom user agent send with every request. |\n\u003c!-- markdownlint-enable --\u003e\n\n## Requirements\n\nThis package supports the following minimum versions:\n\n* Python \u003e= `3.7`\n* `httpx` \u003e= `0.15.0`\n* `pydantic` \u003e= `1.7`\n\nEarlier versions may still work, but we encourage people building new applications\nto upgrade to the current stable.\n\n## License\n\nDistributed under the Apache License. See [LICENSE](LICENSE) for more information.\n","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetsyncr%2Fnotion-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetsyncr%2Fnotion-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetsyncr%2Fnotion-sdk/lists"}