Skip to main content

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

  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)

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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

Notion2Pelican-0.0.4-py3-none-any.whl (9.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page