From 8ed54b0589cb3d94f6161d5a26ba4e868611baa2 Mon Sep 17 00:00:00 2001 From: Dave Date: Mon, 25 Mar 2024 19:18:44 +0100 Subject: [PATCH] add a template for a new example --- docs/examples/_template/.dlt/config.toml | 0 .../_template/.dlt/example.secrets.toml | 0 docs/examples/_template/__init__.py | 0 docs/examples/_template/_template.py | 30 +++++++++++++++++++ 4 files changed, 30 insertions(+) create mode 100644 docs/examples/_template/.dlt/config.toml create mode 100644 docs/examples/_template/.dlt/example.secrets.toml create mode 100644 docs/examples/_template/__init__.py create mode 100644 docs/examples/_template/_template.py diff --git a/docs/examples/_template/.dlt/config.toml b/docs/examples/_template/.dlt/config.toml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/_template/.dlt/example.secrets.toml b/docs/examples/_template/.dlt/example.secrets.toml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/_template/__init__.py b/docs/examples/_template/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/examples/_template/_template.py b/docs/examples/_template/_template.py new file mode 100644 index 0000000000..cdd38f8204 --- /dev/null +++ b/docs/examples/_template/_template.py @@ -0,0 +1,30 @@ +""" +--- +title: Example Template +description: Add desciption here +keywords: [example] +--- + +This is a template for a new example. This text will show up in the docs. + +With this example you will learn to: + +* One +* two +* Three + +""" + +import dlt + +if __name__ == "__main__": + # run a pipeline + pipeline = dlt.pipeline( + pipeline_name="example_pipeline", destination="duckdb", dataset_name="example_data" + ) + # Extract, normalize, and load the data + load_info = pipeline.run([1, 2, 3], table_name="player") + print(load_info) + + # make sure nothing failed + load_info.raise_on_failed_jobs()