Skip to main content

Python bindings for Notion Database API

Project description

Test Python Package

Python Notion Database

Database of Pythonic Notion API

notion-database.gif

created by database from the official Notion API.

"notion database" is Notion API wrapper library.

import os

from notion_database.service.properties import Properties
from notion_database.const.query import Direction, Timestamp
from notion_database import NotionDatabase

result = NotionDatabase.search_database(integrations_token=os.getenv('NOTION_KEY'),
                                        sort={"direction": Direction.ascending, "timestamp": Timestamp.last_edited_time})

for i in result:
  PROPERTY = Properties()
  PROPERTY.set_title("title", "title")
  PROPERTY.set_rich_text("Description", "description text")
  NotionDatabase.create_page(integrations_token=os.getenv('NOTION_KEY'), database_id=i["id"], properties=PROPERTY)

See detailed example here.

License Notice

hope that many people will use this package, also license has been changed to LGPL 3 from 1.0.

previous version is GPL, please be careful when using this out of version.

What's new notion-version

  • 2.0

    • refactor the code to be more readable and maintainable.
  • 1.0.0

    • Now that we've implemented all features,
    • change the version rule to the semantic version.
    • notion-version : "2022-06-28"
  • 2022.08.01

    • Update notion-version (2022-06-28)
  • 2022.03.27

  • 2021.09.01

    • Update notion-version (2021-08-16)

Installing / Getting started

pip install notion-database

Docs

https://notion-database.readthedocs.io

Building / Developing

python setup.py install

Features

  • Blocks
    • ✅ Append block children
    • ✅ Retrieve block children
  • Pages
    • ✅ Create a page
    • ✅ Retrieve a page
    • ✅ Retrieve a page property item
    • ✅ Update page properties
    • ✅ Archive a page
  • Databases
    • ✅ Create a database
    • ✅ Query a database
      • See detailed example here.
    • ✅ Retrieve a database
    • ✅ Update a database
    • ✅ Update database properties
  • Blocks
    • ✅ Retrieve a block
    • ✅ Retrieve block children

Contributing

If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.

Links

Licensing

The code in this project is licensed under LGPL license.

Example project using this package

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

notion_database-2.0.dev0.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

notion_database-2.0.dev0-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file notion_database-2.0.dev0.tar.gz.

File metadata

  • Download URL: notion_database-2.0.dev0.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for notion_database-2.0.dev0.tar.gz
Algorithm Hash digest
SHA256 b48d279afecd90d2d8bc228f074f5a8ee4353eae6a2973c95d07e2ae993548fe
MD5 4b638ed727bbdd358857109ea77043ed
BLAKE2b-256 078b12c92282057e8839edaf37fd14130650ba8f4f885426a1d038b537d8f01b

See more details on using hashes here.

File details

Details for the file notion_database-2.0.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for notion_database-2.0.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 381823545430a3453fae22a73c6f81849f1ccf8208445a364467be7c4fc7ec61
MD5 170d265c1859f1f5a1ae3b0b40c129b5
BLAKE2b-256 30ff510302110216a02c6e64440bc7d25cdc6ad7f0c7798e72588a6b07349612

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page