Skip to main content

A DLT source for notion

Reason this release was yanked:

dependencies broken

Project description


description: dlt source for notion.com keywords: [notion API, notion.com]

dlt-source-notion

PyPI version

DLT source for notion.

Currently loads the following data:

Table Contains
persons Items of the user model of type person
bots Items of the user model of type bot
database_<name>_<shorthash> The database content (pages) of a given database. Columns are all global page columns + selected columns of properties
databases All metadata of each loaded database. Has the title and a reference to the database table as well.
databases__properties Column <-> Label mapping for each unfiltered database property
options_<name>_<shorthash> All options of a select or multi_select in one of the loaded databases.

<shorthash> refers to the hashed id of an entity. The hash is a 4-bit BLAKE2b hash.

Why are you not using the dlt-hub/verified-sources notion source / Differences

The official verified source has a few drawbacks:

  • on usage of the verified source, a copy of the current state of the dlt-hub/verified-sources repository is copied into your project; Once you make changes to it, it effectively becomes a fork, making it hard to update after the fact.
  • This makes use of a preexisting client implementation
  • And Pydantic types for Notion entities, which makes this implementation a lot more stable

Usage

Create a .dlt/secrets.toml with your API key and email:

notion_token = "ntn_abcd12345"

and then run the default source with optional list references:

from dlt_source_notion import source as notion_source

pipeline = dlt.pipeline(
   pipeline_name="notion_pipeline",
   destination="duckdb",
   dev_mode=True,
)
notion_data = notion_source()
pipeline.run(notion_data)

Development

This project is using devenv.

Commands:

Command What does it do?
format Formats & lints all code
sample-pipeline-run Runs the sample pipeline. By default dev_mode=True which fetches resources with a limit of 1 (page)
sample-pipeline-show Starts the streamlit-based dlt hub

Run the sample

NOTION_TOKEN=[...] \
  sample-pipeline-run

alternatively you can also create a .dlt/secrets.toml (excluded from git) with the following content:

notion_token = "ntn_abcd12345"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dlt_source_notion-0.0.2.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dlt_source_notion-0.0.2-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file dlt_source_notion-0.0.2.tar.gz.

File metadata

  • Download URL: dlt_source_notion-0.0.2.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dlt_source_notion-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f7ae8141c026b289613722ea369ddf5e1addf9c5f9757b7d112e6b06baac1870
MD5 3ef37e7e2c67fa15cf8c9726fa84fdd4
BLAKE2b-256 4f8e152206c3e6993473f2e55551ae3f6a032dd66e7d5164f64573278f3cb722

See more details on using hashes here.

Provenance

The following attestation bundles were made for dlt_source_notion-0.0.2.tar.gz:

Publisher: test.yml on planet-a-ventures/dlt-source-notion

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dlt_source_notion-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for dlt_source_notion-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3296f64d6f5b28e31a69e8fa4c6e11e980e544038511937c12b95a10f68f1fd7
MD5 99c89c57f26c09a1e996b97f3a780c86
BLAKE2b-256 505803a3500d2055309def22fdc1fb5a9f1d29dd820a5120d76c5ca0d8b48e03

See more details on using hashes here.

Provenance

The following attestation bundles were made for dlt_source_notion-0.0.2-py3-none-any.whl:

Publisher: test.yml on planet-a-ventures/dlt-source-notion

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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