A small repository with convenience functions for working with the Notion API.

Overview

Welcome!

Within this respository are a few convenience functions to assist with the pulling and pushing of data from the Notion API. Given your credential file and database you want to access, you can pull back cleanly formatted json tables to lookup by database row_id or field name. For each type of object in the Notion database, I am using pre-defined functions to extract only core information - the field value or the plain text. You can access the raw data by using .raw_data of the NotionData class object. Please note, not every type of field is accounted for in this custom parsing.

Field types which are implemented include:

  • date (takes single input and returns start and end dates formatted in python datetime format for convenience)
  • relation (returns relation IDs which can be passed back through .query_id() to return record information)
  • text (returns plain text value)
  • rich_text (returns plain text value)
  • title (returns plain text value)
  • select (returns plain text value)
  • checkbox (returns True False boolean based on if box was checked)

I do not plan on implementing additional field types at this time - if you need additional functionality please feel free to fork this repo and/or submit a pull request. These scripts are provided without guarantee or warrenty; as of writing this, all scripts have worked for my purposes and I will continue to update the code as I notice data structure changes within my own projects. Please note that any changes to how Notion returns field type data may lead to breakage.

Quickstart:

notion_data = NotionData(DATABASE_ID, INTEGRATION_TOKEN)
notion_data.summary() #quick summary of returned records and structure of first record
notion_data.data #returns the full raw data for custom json parsing
notion_data.fields #returns all fields in database for reference
notion_data.field_types #returns the field types of the fields for custom logic on parsing the json based on elements specific to a type
notion_data.row_ids #unique match-keys that represent a row within a data table

Return all row_id & values for a given field:

notion_data.query_field()['field_name']

Return all record information for a given row_id:

notion_data.query_id()['row_id']

Searching using regex to return all records matching the lookup:

# Returns matching ids & record data
match_pattern = r'testlookup' #appropriate re.match regex string
my_lookup = notion_data.lookup(match_pattern, field)
my_lookup[0] #matching id values
my_lookup[1] #records corresponding to id values

This is a DCA crypto trading bot built for Binance written in Python

This is a DCA crypto trading bot built for Binance written in Python. It works by allowing you to DCA at an interval of your choosing and reports back on your average buy price as well as a chart con

Andrei 55 Oct 17, 2022
A Python IRC bot with dynamically loadable modules

pybot This is a modular, plugin-based IRC bot written in Python. Plugins can bedynamically loaded and unloaded at runtime. A design goal is the abilli

Jeff Kent 1 Aug 20, 2021
An unofficial python wrapper for the comdirect API for private consumers.

An unofficial python wrapper for the comdirect API for private consumers.

Alexander Knittel 18 Nov 30, 2022
Discord bot do sprawdzania ceny pizzy.

Discord bot do sprawdzania ceny pizzy w pizzeri Bombola. Umieszczony jest na platformie Heroku, dzięki czemu działa 24/7. Commands List Info: Jako com

1 Sep 18, 2021
For Help/Questions Join in discord

Simple-Nitro-Generator-Source Must have installed python! Discord: $MartoBossX#7777 Server: https://discord.gg/ErynDxTV5Y DONATE: (Crypto) BTC: bc1qg8

1 Jan 08, 2022
Celestial - a Python regex Discord chatbot who can talk with you.

Celestial a Python regex Discord chat bot who can talk with you. Invite url: https://discord.com/api/oauth2/authorize?client_id=927573556961869825&per

Jirayu Kaewsing 3 Jan 01, 2023
My telegram bot to download Instagram Profiles

Instagram Profile Get for Telegram My telegram bot to download Instagram Profiles First you have to get a telegrm bot api key from @BotFather Then you

Ali Yoonesi 2 Sep 22, 2022
Simple spam bot made in python

Simple Spam Bot A Simple and easy way to be the most hated person between your friends, All you have to do is spam the group chat using this bot until

Kareem Osama 6 Sep 05, 2022
This is a Innexia Group Manager Bot with many features

⚡ Innexia ⚡ A Powerful, Smart And Simple Group Manager ... Written with AioGram , Pyrogram and Telethon... Available on Telegram as @Innexia ❤️ Suppor

TeamDeeCode 84 Jun 04, 2022
Anti Spam/NSFW Telegram Bot Written In Python With Pyrogram.

✨ SpamProtectionRobot ✨ Anti Spam/NSFW Telegram Bot Written In Python With Pyrogram. Requirements Python = 3.7 Install Locally Or On A VPS $ git clon

Akshay Rajput 46 Dec 13, 2022
🎄 JustaGrabber - A discord token grabber written in python3

🎄 JustaGrabber - A discord token grabber written in python3 🎇 Made by kldiscord https://github.com/kldiscord 🌟 Please leave a star if you liked Jus

1 Dec 19, 2022
NiceHash Python Library and Command Line Rest API

NiceHash Python Library and Command Line Rest API Requirements / Modules pip install requests Required data and where to get it Following data is nee

Ashlin Darius Govindasamy 2 Jan 02, 2022
Mixcloud API wrapper for Python and Async IO

aiomixcloud Mixcloud API wrapper for Python and Async IO aiomixcloud is a wrapper library for the HTTP API of Mixcloud. It supports asynchronous opera

Aristotelis Mikropoulos 26 Dec 31, 2022
Python SDK for interacting with the Frame.io API.

python-frameio-client Frame.io Frame.io is a cloud-based collaboration hub that allows video professionals to share files, comment on clips real-time,

Frame.io 37 Dec 21, 2022
Shred your reddit comment and post history

trasheddit Shred your reddit comment and post history (x89/Shreddit replacement) Usage Simple Example Download trasheddit: git clone https://github.co

Elly 2 Jan 05, 2022
This Is A Python Program To Showcase Two Modules (Gratient And Fade)

Hellooo, It's PndaBoi Here! This Is A Python Program To Showcase Two Modules (Gratient And Fade). I Really Like Both Of These Modules So I Decided To

PndaBoi! 6 May 31, 2022
The modern Lavalink wrapper designed for discord.py

Pomice The modern Lavalink wrapper designed for discord.py This library is heavily based off of/uses code from the following libraries: Wavelink Slate

Gstone 1 Feb 02, 2022
A fully decentralized protocol for private transactions FAST snipe BUY token on LUANCH after add LIQUIDITY

TORNADO CASH Pancakeswap Sniper BOT 2022-V1 (MAC WINDOWS ANDROID LINUX) ⭐️ A fully decentralized protocol for private and safe transactions ⭐️ AUTO DO

Crypto Trader 2 Jan 06, 2022
Isobot is originally made by notsniped. This is a remix of iso.bot by archisha.

iso6.9-1.2beta iso.bot is originally made by notsniped#0002. This is a remix of iso.bot by αrchιshα#5518. iso6.9 is a Discord bot written in Python an

Kamilla Youver 3 Jan 11, 2022
Telegram tools

Telegram-Tools Telegram tools. Explanation English | 中文 Features Export group memebrs Add users to the group Send message to users Setup API Open http

4 Apr 02, 2022