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

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-1.0.0.tar.gz (14.5 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.0.0-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file notion-database-1.0.0.tar.gz.

File metadata

  • Download URL: notion-database-1.0.0.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for notion-database-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6556ca7a09889d1c77cd91e7fd5e02cea48f74443de30c8f799130ed423e70e3
MD5 c8094b3fb6c68b94af0f737abb926d82
BLAKE2b-256 6815de84bfbbfbbb196525025a2c8eda079af24427fc894edb4b81039ced15d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for notion_database-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a7c31d46177e2eb48db4af93ac501843a18686ac780f975f1c62c4ca74592a6c
MD5 1cd773ef0a54627691d6263796762b16
BLAKE2b-256 8f8e38881197ef05e918aecc54088d8e66460aeb1e07a67e6f58d3776a5498fc

See more details on using hashes here.

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