Skip to main content

A package for synchronizing data in Notion Database through Notion official api.

Project description

Notion Database Bot

Notion-Database-Bot is a python tool for synchronizing data in Notion Database through Notion official api. The main purpose is to facilitate the recording of daily experimental data.

Installation

pip install notion-database-bot

Prerequisites

  1. Create an integration, then you can get your own Internal Integration Token (token).

  2. Share a database with your integration.

  3. Get your target database ID (database_id):

    Here's a quick procedure to find the database ID for a specific database in Notion:

    Open the database as a full page in Notion. Use the Share menu to Copy link. Now paste the link in your text editor so you can take a closer look. The URL uses the following format:

    https://www.notion.so/{workspace_name}/{database_id}?v={view_id} Find the part that corresponds to {database_id} in the URL you pasted. It is a 36 character long string. This value is your database ID. Note that when you receive the database ID from the API, e.g. the search endpoint, it will contain hyphens in the UUIDv4 format. You may use either the hyphenated or un-hyphenated ID when calling the API.

Usage

  • Init your Bot:

    from notion_database_bot import NotionDatabaseBot
    bot = NotionDatabaseBot(token)
    
  • Read database content:

    content = bot.read_database(database_id)
    
  • Add a page/row/sample to database

    temp_dict = {"Model": "bert-base-uncased", "ppl": "5.21"}
    properties = bot.dict2properties(temp_dict, "Model")
    bot.create_page(database_id, properties)
    

References:

Project details


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_bot-0.0.5.tar.gz (3.7 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_bot-0.0.5-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file notion_database_bot-0.0.5.tar.gz.

File metadata

  • Download URL: notion_database_bot-0.0.5.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.3

File hashes

Hashes for notion_database_bot-0.0.5.tar.gz
Algorithm Hash digest
SHA256 40f0e0b4c56aa73523e4f4a024790f3a24b2a12b882483333ad62853c94d0ed4
MD5 d1540a2222a718687765d31fbfcf652b
BLAKE2b-256 8ae86a0fd93acd4054bf02cbea56bc11642befc6227ef1034d2e87f5c27ece96

See more details on using hashes here.

File details

Details for the file notion_database_bot-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for notion_database_bot-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 2612df4ceb5f9c19ef9eda0f45e8bfb140dba36409d073f1c3690aabd5fe73f8
MD5 b216a1af7de98193a39f68d9d0dba97c
BLAKE2b-256 a1170db150d4bc41ee0af4a77b9c5e043b8893d7a80836c3d0cd6f71ab124b87

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