Skip to main content

Notion API implementation for Python

Project description

Notyon

Notion SDK for Python

Notyon Logo

Notyon is an open source Python package that implements the Notion API in Python.

Installation

Run the following command to install: pip install notyon

How to get your Notion auth token

Follow this tutorial: Get your Notion auth token

Basic Example

import notyon as Notion # Import Notyon

# Create an notion client instance
client = Notion.client("auth_token")

# Find a Database
# If found: Returns a Database instance
# If not found: Returns None
found_database = Notion.Database.find(client, "Database name")

# Get database info
db_title = found_database.title
db_id = found_database.id

# Retrieve database content
content = found_database.retrieve()

## Create a database
# If created: Returns a Database instance
# If didn't create: Returns None

# First, get the page_id (parent)[
page_id = "page-id-example"

# Second, create the model
model = Notion.Model("Database title")
model.add([
    #{"field name": "field type"}
    {"name": "text"},
    {"description": "rich_text"}
])

created_database = Notion.Database.create(client, page_id, model)

Roadmap 🗺️

  • 🗃️ Database 1 (v0.1)

    • Retrieve
    • Create
  • 🗃️ Database 2 (v0.2)

    • Update
    • Query
  • 📄 Pages 1 (v0.3)

    • Retrieve
    • Create
    • Delete
  • 📄 Pages 2 (v0.4)

    • Update
    • Query
  • 🔳 Blocks 1 (v0.5)

    • Retrieve
    • Create
  • 🔳 Blocks 2 (v0.6)

    • Update
    • Query
  • 👤 Users (v0.7)

    • Retrieve an user
    • List
  • 🔍️ Search (v0.8)

    • Query pages
  • 🖇️ Retrieve a page property item (0.9)

  • 🔑 Retrieve your token's bot user (1.0)

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

notyon-0.1.7.tar.gz (30.1 kB view hashes)

Uploaded Source

Built Distribution

notyon-0.1.7-py3-none-any.whl (8.5 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