NotionCLI - The CLI tool for Notion.co (https://www.notion.so/ja-jp/product).
Project description
NotionCLI
NotionCLI - The CLI tool for Notion.co (https://www.notion.so/ja-jp/product).
Installation
- To install NotionCLI with pip, run:
pip install notion-cli-py
How to use
Create Integration
To use the notion api, you need to create an integration. Please create it here.
Setup
After installation, you are required to create config file first. Please run following command.
$ notion-cli configure set
Then you need to put your integration information about the following questions.
Are you sure to create config file in /Users/hiratatomonori/.notion_cli? [y/N]: # Type 'y'.
input config label name: # Type your integration name (e.g. "NotionCLI").
input token for NotionCLI: # Type your integration token.
Do you want to set label (LABEL NAME) to current label? [y/N]: # Type 'y' (if this is your first setting).
Please run following command and check that the configuration is completed properly.
### Check if the target page has the integration that set above.
$ notion-cli get pages ${PAGE_ID}
If page information can be retrieved the minimum setup is complete.
Basic Commands
For more detailed information, run notion-cli <command> - --help
or notion-cli <command> <subcommand> - --help
.
Get (Retrieve) Operations
### get pages information
$ notion-cli get pages ${PAGE_IDS}
### get pages properties
$ notion-cli get page_properties ${PAGE_IDS} ${PROPERTY_ID}
### get databases information
$ notion-cli get databases ${DATABASE_IDS}
### get blocks information
$ notion-cli get blocks ${BLOCK_IDS}
### get block children information
$ notion-cli get block_children ${BLOCK_IDS}
### get users information
$ notion-cli get users ${USERS_IDS}
### get all users information
$ notion-cli get all_users
Create Operations
### create pages
$ notion-cli create pages ${PALENT_PAGE_IDS} --read-path=${YOUR_FILE_PATH}
### create databases
$ notion-cli create databases ${PALENT_PAGE_IDS} --read-path=${YOUR_FILE_PATH}
Update Operations
### update pages
$ notion-cli update pages ${PALENT_PAGE_IDS} --read-path=${YOUR_FILE_PATH}
### update databases
$ notion-cli update databases ${PALENT_PAGE_IDS} --read-path=${YOUR_FILE_PATH}
### update blocks
$ notion-cli update blocks ${PALENT_PAGE_IDS} --read-path=${YOUR_FILE_PATH}
Delete Operations
### delete blocks
$ notion-cli delete blocks ${BLOCK_IDS}
Append Operations
### append block children
$ notion-cli append block_children ${BLOCK_IDS} --read-path=${YOUR_FILE_PATH}
Configure Operations
### set your integration information
$ notion-cli configure set
### show your integration information
$ notion-cli configure show
### switch integration
$ notion-cli configure switch ${LABEL_NAME}
Query Operations
### query databases
$ notion-cli query databases ${YOUR_FILE_PATH}
Search Operations
### search objects
$ notion-cli search data ${YOUR_FILE_PATH}
License
Licensed under the MIT License.
Disclaimer
This is NOT an official Notion product.
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
File details
Details for the file notion-cli-py-1.0.1.tar.gz
.
File metadata
- Download URL: notion-cli-py-1.0.1.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.10 Darwin/20.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1278c7877ce3fc39b3ba669955a637a6b4d79b20669b6e810a3c6f33c11e9e4c |
|
MD5 | 286142e5d5d43ab80c8c24b7bafe6dc5 |
|
BLAKE2b-256 | 231702e247a975a20b63ea8397016dfefe15fecf6cce91ed6b07133732f6edb2 |
File details
Details for the file notion_cli_py-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: notion_cli_py-1.0.1-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.10 Darwin/20.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 321cdefe22e5c1e3dc98ec0855eca8cf99d1b22b152c6fd18da3480e98dd32d5 |
|
MD5 | b661207976df435900f163ada04ab277 |
|
BLAKE2b-256 | 13c747b4c9d25d244c8f0698b921674c373cc7b50e3a82d93aee436d21e9d60f |