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.page import Page
from notion_database.properties import Properties
from notion_database.const.query import Direction, Timestamp
from notion_database.search import Search

S = Search(integrations_token=os.getenv('NOTION_KEY'))
S.search_database(query="", sort={"direction": Direction.ascending, "timestamp": Timestamp.last_edited_time})
for i in S.result:
  PROPERTY = Properties()
  PROPERTY.set_title("title", "title")
  PROPERTY.set_rich_text("Description", "description text")
  P = Page(integrations_token=os.getenv('NOTION_KEY'))
  P.create_page(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

  • 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

This version

1.4.1

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-1.4.1.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

notion_database-1.4.1-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

Details for the file notion_database-1.4.1.tar.gz.

File metadata

  • Download URL: notion_database-1.4.1.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for notion_database-1.4.1.tar.gz
Algorithm Hash digest
SHA256 105e73baa116fb0435ccd664d81173570ba1fe760f21abeaf7f418e0bb21155e
MD5 732ff87996d60afea60d28be52dcd857
BLAKE2b-256 0396cab0aeae1f457729436cb77f9234d4484e88eab8a540c306bacf4b61a3aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for notion_database-1.4.1.tar.gz:

Publisher: publish-to-pypi.yml on minwook-shin/notion-database

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file notion_database-1.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for notion_database-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ed3333efbd68cfc6760d699c6eee1d21157d74952b49ac8b0b9897a1b63832be
MD5 edee2cb7434bd313ea0aced7153e4679
BLAKE2b-256 58fd7e9c11fc2afd5b8d8826552f8dccf341826488ab196d6780f7a2abc74b1e

See more details on using hashes here.

Provenance

The following attestation bundles were made for notion_database-1.4.1-py3-none-any.whl:

Publisher: publish-to-pypi.yml on minwook-shin/notion-database

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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