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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f95d062c9a27232dfe60d5a5213efc2ea5aebefd672ae9e5d2e66b4edf1fa4d
|
|
| MD5 |
c954c29483ce10df3924613a39e76edd
|
|
| BLAKE2b-256 |
afa056fdad1f8985d1e1eb16cfcbfaa3f177958d64b7878997c722ca6df3b8de
|
File details
Details for the file secnex_notion_api-0.0.6-py3-none-any.whl.
File metadata
- Download URL: secnex_notion_api-0.0.6-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9249ca24fa6cedd66c99b402f9b8b70106d26de9f9ae6377228925fd517f34dd
|
|
| MD5 |
603c52a3b98fff6a1097cb0bc1bc4bbd
|
|
| BLAKE2b-256 |
68fb465be3aef8547e62fb99182d1b9393827175386708517c07dd20cfbe9114
|