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 hashes)

Uploaded Source

Built Distribution

notion_database_bot-0.0.5-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

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