Skip to main content

A package to interact with the Notion API

Project description

SecNex Notion API Wrapper

This is a wrapper for the Notion API. You can use it to create, update, and delete pages, blocks, and more.

Features

Blocks

  • Paragraph
  • Callout
  • Headings
  • Code
  • Image
  • Video
  • File
  • To-do
  • Toggle
  • Table
  • Divider

Properties

  • Property
  • Checkbox
  • Multi-select
  • Select
  • Text
  • Title
  • Description

Pages

Installation

pip install secnex-notion-api

Usage

from notion import Client, Components, Properties

import os

def main():
    client = Client(token=os.getenv("NOTION_API_KEY"))

    template_page = client.search(query="Tickets", filter={"property": "object", "value": "database"})

    page = Components.Page(
        parent=template_page["results"][0],
        parent_type="database",
        icon="👋",
        properties=[
            Properties.Property(field="Name", value="Test"),
            Properties.Checkbox(field="Checkbox", value=True),
            Properties.MultiSelect(field="Multi-select", value=[
                Properties.MultiSelectOption(name="Test"),
                Properties.MultiSelectOption(name="Test One", color="blue")
            ]),
            Properties.Select(field="Priority", value=Properties.SelectOption(name="Wow", color="blue"))
        ],
        blocks=[
            Components.Paragraph(text=["Hello, world!"]),
            Components.Callout(text="Hello, world!", icon="👋", color="default")
        ]
    )

    print(client.new(page))

if __name__ == "__main__":
    main()

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

secnex_notion_api-0.0.6.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

secnex_notion_api-0.0.6-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file secnex_notion_api-0.0.6.tar.gz.

File metadata

  • Download URL: secnex_notion_api-0.0.6.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for secnex_notion_api-0.0.6.tar.gz
Algorithm Hash digest
SHA256 9f95d062c9a27232dfe60d5a5213efc2ea5aebefd672ae9e5d2e66b4edf1fa4d
MD5 c954c29483ce10df3924613a39e76edd
BLAKE2b-256 afa056fdad1f8985d1e1eb16cfcbfaa3f177958d64b7878997c722ca6df3b8de

See more details on using hashes here.

File details

Details for the file secnex_notion_api-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for secnex_notion_api-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9249ca24fa6cedd66c99b402f9b8b70106d26de9f9ae6377228925fd517f34dd
MD5 603c52a3b98fff6a1097cb0bc1bc4bbd
BLAKE2b-256 68fb465be3aef8547e62fb99182d1b9393827175386708517c07dd20cfbe9114

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