* bump npm deps * remove unneeded netlify redirects file * remove unneeded lockfile * remove another unneeded lockfile * post rebase lockfile update * remove old netlify command * create new docs tools project and move api docs gen there * tmp * add uv to build docs workflow * move docs pyproject * re-org docs pcakage and move snippet linter * move notebook linting commands and deps to tools folder add flake8 to tools linting * remove unneeded files * fix linting and formatting errors * remove wrong file * move docs processing script to new package * fix gen api ref * clean up package json and use commands from parent makefile * update build website workflow * move linting to docs makefile partially * fix python version for docs project * consolidate docs commands in docs makefile * fix docs linter * fully update docs test flow * fixes some linting and dependency problems * fix constants * move notebook formatting to docs project * fix lint embedded snippets * fix examples tests * add missing dependencies * fix snippet linting * add missing lint dependencies to core and missing test dependencies to docs * add missing weaviate * add missing regex module * add forked dependency and updates readme file * revert accidental change to example * fix main linter * * Move relevant pytest options to subproject * Remove shims / path inserts that are now managed by pytest options * Some typing fixes * Clean up base project pytest ini * Enable transformation snippets tests * remove unneeded raw import of intro snippets * downgrade alive progress * uses dlt logger which also fixes internal alive error * enables transformation snippets linting * fixes dashboard races again --------- Co-authored-by: Marcin Rudolf <rudolfix@rudolfix.org>
Writing Source Extractors
dlt sources are iterators or lists and writing them does not require any additional knowledge beyond basic python. dlt sources are also pythonic in nature: they are simple, can be chained, pipelined and composed like any other python iterator or a sequence.
Examples
-
quickstartloads a nested json document intoduckdband then queries it with built insql_clientdemonstrating the parent-child table joins. -
sql_querysource andread_tableexample. This source iterates over anySELECTstatement made against database system supported bySqlAlchemy. The example connects to Redshift and iterates a table containing Ethereum transactions. Shows the inferred schema (which nicely preserves typing). Mind that our source is a one-liner :) -
rasaexample andrasa_tracker_storesource extracts rasa tracker store events to a set of inferred tables. It shows a few common patterns
- shows how to pipeline resources: it depends on a "head" resource that reads base data (ie. events from kafka/postgres/file). the dependent resource is called
transformer - it shows how to write stream resource which creates table schemas and sends data to those tables depending on the event type
- it stores
last_timestamp_valuein the state
singer_tap,stdoutandsinger_tap_exampleis fully functional wrapper for any singer/meltano source
- clones the desired tap, installs it and runs it in a virtual env
- passes the catalog and config files
- like rasa it is a transformer (on stdio pipe) and
streamresource - it stores singer state in
dltstate
-
singer_tap_jsonl_examplelike the above but instead of process pipe it reads singer messages from file. it creates a huge hubspot schema. -
google_sheetsa source that returns values from specified sheet. The example takes a sheet, infers a schema, loads it to BigQuery/Redshift and displays inferred schema. it uses thesecrets.tomlto manage credentials and is an example of one-liner pipeline -
chessan example of a pipeline project with its own config and credential files. it is also an example of how transformers are connected to resources and resource selection. it should be run from examples/chess` folder. It also shows: how to use retry decorator and how to run resources/transformers in parallel with a decorator -
chess/chess_dbt.py: an example of adbttransformations package working with a dataset loaded bydlt. The package is incrementally processing the loaded data following the new loaded packages stored in_dlt_loadstable at the end of every pipeline run. Note the automatic usage of isolated virtual environment to run dbt and sharing of the credentials. -
run_dbt_jaffleruns dbt's jaffle shop example taken directly from the github repo and queries the results withsql_client.duckdbdatabase is used to load and transform the data. The databasewriteaccess is passed fromdlttodbtand back.
Not yet ported:
-
discord_iteratoran example that load example discord data (messages, channels) into warehouse from supplied files. Shows several auxiliary pipeline functions and an example of pipelining iterators (withmapfunction). You can also see that produced schema is quite complicated due to several layers of nesting. -
ethereumsource shows that you can build highly scalable, parallel and robust sources as simple iterators.