数据加载工具 (dlt) 是一个让数据加载变得简单的 开源 Python 库 ️
无论是 Google Colab 笔记本、AWS Lambda 函数、Airflow DAG、你的本地笔记本电脑,
还是 AI 编码智能体——dlt 都可以随处部署。
加入我们蓬勃发展的志同道合开发者社区,共同构建未来!
dlt 支持 Python 3.10 到 Python 3.14。请注意,部分可选扩展组件尚未支持 Python 3.14,因此对该版本的支持仍被视为实验性功能。
pip install dlt为你的数据源和目标添加所需的额外依赖,例如:
pip install "dlt[duckdb]" # local DuckDB destination
pip install "dlt[bigquery]" # or snowflake, postgres, redshift, databricks, athena, ...
pip install "dlt[s3]" # or gs, az for cloud filesystems
pip install "dlt[sql_database]" # read from any SQL database
pip install "dlt[hub]" # data quality, transformations, and AI (see below)更喜欢使用 uv?uv add "dlt[duckdb]"。
以声明式方式描述一个 API 并将其加载到 DuckDB 中 —— dlt 会为你处理请求、分页、模式推断和类型标注:
………或者加载任何 Python 可迭代对象 —— resource 只是一个生成器,dlt 会推断模式、为列标注类型并写入表:
import dlt
@dlt.resource(table_name="tracks", primary_key="id", write_disposition="merge")
def tracks():
yield {"id": 1, "title": "Yellow", "artist": "Coldplay", "streams": 4_200_000_000}
yield {"id": 2, "title": "Shape of You", "artist": "Ed Sheeran", "streams": 3_900_000_000}
dlt.pipeline(
destination="duckdb",
dataset_name="spotify_data",
).run(
source=tracks(),
)查看 Colab 中的基础示例,或更高级的 [使用 Marimo notebook 的 Hugging Face 演示](https://molab.marimo.io/github/marimo-team/gallery-examples/blob/main/notebooks
暂无开放 Issues,或尚未同步最近议题。