No project description provided
Project description
notion-tree
Hierarchic operations with Notion API, thanks to notion-py.
Requirements
- Python ≥ 3.6
- aureplop/notion-py, fork of https://github.com/jamalex/notion-py, with importFile feature
Installation
# Required as PyPI does not accept package with dependency links
$ pip install git+https://github.com/aureplop/notion-py.git@feat-import-file#egg=notion-999
$ pip install notion-tree
Usage
# Obtain the `token_v2` value by inspecting your browser cookies on a logged-in session on Notion.so
$ NOTION_TOKEN=...
$ python -m notiontree.hierarchy --dir path/to/local/root --root-parent-url https://www.notion.so/id/to/parent/of/local/root
Assuming you had this hierarchy on Notion:
workspace
└── parent-root # URL: https://www.notion.so/id/to/parent/of/local/root
And that you have this local structure:
path/to/local
└── root
├── index.md
├── dir1
│ ├── index.md
│ └── page1.md
└── dir2
└── page2.md
After running the command above, you will get this structure on your Notion workspace:
workspace
└── parent-root # URL: https://www.notion.so/id/to/parent/of/local/root
└── root # Includes links to dir1 and dir2 + content of root/index.md
├── dir1 # Includes links to dir1/page1.md + content of root/dir1/index.md
│ └── page1.md
└── dir2 # Includes links to dir2/page2.md
└── page2.md
Todos
- Split 'notiontree/hierarchy.py' to multiple modules.
- Use 'click' for CLI.
- Document --github-wiki-root in README.
- Create stub pages in another page than 'root' to be able to import root index.html w/o removing other stub pages.
- Accept other filenames for index files (currently limited to 'index.md').
- Improve link resolver configuration.
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
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 notion_tree-0.0.1a4-py3-none-any.whl.
File metadata
- Download URL: notion_tree-0.0.1a4-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5688d0a6f344afe4a2b4d8ea058b2bc81026b0c2e921502916e944809fbe30f2
|
|
| MD5 |
cfaec7164ec134e867d775c39988659e
|
|
| BLAKE2b-256 |
26b91197dfc3b132fcabfd186574fa481f4de5bf3d137c6c475ef67126710b46
|