integrate notion api with your workflow
Project description
auto-py-notion
for creating,updating and querying databases and pages , auto-py-notion is a python module to help you integrete notion with your software/workflow
installation
in your terminal :
pip install py-notion
Requirments
before we get started there are a couple of things we need to do :
-
create an integration and grab a token from here
-
share the integration with you database or page
-
get the id of the database or page :
https://www.notion.so/myworkspace/a8aec43384f447ed84390e8e42c2e089?v=...
the database id is before the question mark and after the backslash
more details from official notion docs
Getting Started
let's create a sample page inside a database :
from NotionPy.notionpy import NotionClient
inst = NotionClient("Your integration token")
inst.create.page(
database_id="the id of database of choice",
data=[ # List of tuples # provided properties must be created first in the db
("Name", "title", "kareem"),
("price", "number", 254),
("to-do", "checkbox", False),
],
#Optional
icon="🔥",
#Optional
cover="https://images.unsplash.com/photo-1523867574998-1a336b6ded04?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8Y292ZXJ8ZW58MHx8MHx8&w=1000&q=80",
)
currently there is no support for creating empty pages or empty values but look forward for feature updates
retreiving data from a database :
inst.query.db("id of the database",
in_json=True, #Optional
json_indent=2, #Optional
print_data=True #Optional
)
Upcoming Updates
- Add filters and sorts to querying databases for
- Add children objects in page creating
- Add number formating
- Add support for saving the query data in a json file
Notes
- there are other modules that interact with notion's API so what makes this module different ? it is the fact that , as far as my research went , it is the most userfriendly and practical one
- This module is still fairly simple and has a lot to offer in the future , so all of your suggestions , issues , contributions are very welcomed
Project details
Release history Release notifications | RSS feed
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
Hashes for auto_py_notion-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7cc17a792a5517dba07f93cdb92d23f184658255a0bf1bdda01bc2b4aad6c82 |
|
MD5 | c9aa0496461f9e9668097f026017eed4 |
|
BLAKE2b-256 | f2edf39a22273c9e3bbb71197b0f67a9b3cbf267352b0e55d849b04c7a1cff08 |