Import notion pages in pelican blogging format
Project description
Notion2Pelican
Import Notion Pages into a Pelican compatible folder structure and files
[!IMPORTANT]
For this to work you need the ID of your notion database and the key which are available from your notion dashboard
-
how to get the ID: https://docs.tooljet.com/docs/data-sources/notion/#:~:text=Database%20ID%3A%20You'll%20find,ZZZ%20is%20the%20page%20ID.
-
how to get the secret: https://docs.tooljet.com/docs/data-sources/notion/#:~:text=Database%20ID%3A%20You'll%20find,ZZZ%20is%20the%20page%20ID.
-
Select the page and grant access to the connection (to right ..., select Connections, Connect to, type the name of your integration).
Examples
See the ./docs folder for minimalist code which imports a Notion DB into a pelican blogging and generates the static site.
[!IMPORTANT]
The below example relies on the secrets to be in a local .env file (which containing secrets has to be created for each machine) with the following keys:FT_dbid
the ID of your databaseNOTIONKEY
which usually starts withsecret_
and is available from your Notion dashboard
[!IMPORTANT]
Integrations have a scope of the workspace they are created for
cd docs python example.py
Release Notes and Roadmap
v0.0.4 - fixed bugs
- related to local cache of AWS stored images: added handling of multiple images with same name
- added handling of images not on AWS (today they are ignored)
v0.0.3 - adding support for:
- download images locally
- download DB into .csv
v0.0.2 - adding support for
- add support for H1 (which was not present)
- numbered list (which was not working)
- italic and bold (which was not available)
- non regression for images (though it was working)
- add support for quotes
v0.0.1 (first release)
Supports:
- Titles (H1, H2, )
- Bulleted items
- images
Upcoming
Roadmap
Release process
- run pyroma (should be 10/10)
pyroma .
- run flake8 runs with darglint settings for docstrings to numpy standard set in the .flake8 file should yield 0 warnings or errors
flake8
- run pytest should yield 100% pass
pytest
- run coverage
coverage run -m pytest
- run coverage report (should be 100%)
coverage report
- run tox
7.run sphinx-api
updates the *.rst in docs/ folder
sphinx-apidoc -f -o docs Notion2Pelican
- run sphinx-build (updates the read_the_docs folder)
sphinx-build -b html docs build/html
- release to pypi-test
python setup.py bdist_wheel
twine upload -r testpypi dist*
-
check updates on read_the_docs
-
check on google colab it works
-
release on pypi (assumes your pypirc is local to the project)
twine upload -r pypi --config-file=..pypirc dist*
- check on colab that pypi package works:
!python -m pip install Notion2Pelican from Notion2Pelican import version print(version)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file Notion2Pelican-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: Notion2Pelican-0.0.4-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35cd292bcb5566b9b6948d95dee20b5ca25ec4d8f20816816516c4504d6479a7 |
|
MD5 | 23fbe7b29f89476254b8f5255542dd78 |
|
BLAKE2b-256 | 7d22301059e6d154296b5782e2f5373d63df1877db2848e2533b020b1773504d |