Skip to main content

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

  1. 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.

  2. 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.

  3. 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 database NOTIONKEY which usually starts with secret_ 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

  1. run pyroma (should be 10/10)

pyroma .

  1. run flake8 runs with darglint settings for docstrings to numpy standard set in the .flake8 file should yield 0 warnings or errors

flake8

  1. run pytest should yield 100% pass

pytest

  1. run coverage

coverage run -m pytest

  1. run coverage report (should be 100%)

coverage report

  1. run tox

7.run sphinx-api updates the *.rst in docs/ folder

sphinx-apidoc -f -o docs Notion2Pelican

  1. run sphinx-build (updates the read_the_docs folder)

sphinx-build -b html docs build/html

  1. release to pypi-test

python setup.py bdist_wheel

twine upload -r testpypi dist*

  1. check updates on read_the_docs

  2. check on google colab it works

  3. release on pypi (assumes your pypirc is local to the project)

twine upload -r pypi --config-file=..pypirc dist*

  1. check on colab that pypi package works:

!python -m pip install Notion2Pelican from Notion2Pelican import version print(version)

Metadata

Release files for Notion2Pelican 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for Notion2Pelican 0.0.4
File Interpreter ABI Platform
Notion2Pelican-0.0.4-py3-none-any.whl Python 3 none any Details

Release files / Notion2Pelican-0.0.4-py3-none-any.whl

Download URL Notion2Pelican-0.0.4-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
35cd292bcb5566b9b6948d95dee20b5ca25ec4d8f20816816516c4504d6479a7
BLAKE2b-256 checksum
How to use checksums
7d22301059e6d154296b5782e2f5373d63df1877db2848e2533b020b1773504d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.1

Release history Release notifications | RSS feed

This release

0.0.4 This release

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page