TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/dlt-hub/dlt/llms.txt
Use this file to discover all available pages before exploring further.
DltSource class groups multiple resources under a single schema and provides methods to manage and configure them. Sources are created using the @dlt.source decorator.
Creating a Source
Sources are created by decorating a function with@dlt.source:
Properties
name
The name of the source, derived from the schema name.str - The source name
Source: ~/workspace/source/dlt/extract/source.py:390
schema
The schema associated with the source.Schema - The schema object
Source: ~/workspace/source/dlt/extract/source.py:485
resources
A dictionary of all resources in the source.DltResourceDict - Dictionary of resources keyed by name
Source: ~/workspace/source/dlt/extract/source.py:467
selected_resources
A dictionary of only the selected resources that will be loaded.Dict[str, DltResource] - Dictionary of selected resources
Source: ~/workspace/source/dlt/extract/source.py:476
exhausted
Checks if the source has been iterated and cannot be used again.bool - True if source is exhausted
Source: ~/workspace/source/dlt/extract/source.py:457
max_table_nesting
Schema hint that sets the maximum depth of nested tables.int - Maximum nesting level
Source: ~/workspace/source/dlt/extract/source.py:395
root_key
Enables merging on all resources by propagating root foreign key to nested tables.Optional[bool] - Root key propagation setting
Source: ~/workspace/source/dlt/extract/source.py:409
schema_contract
Schema contract settings for the source.TSchemaContract - Schema contract settings
Source: ~/workspace/source/dlt/extract/source.py:449
state
Gets source-scoped state from the active pipeline.StrAny - Dictionary containing source state
Source: ~/workspace/source/dlt/extract/source.py:584
Methods
with_resources()
Selects specific resources to be loaded. Returns a clone of the source with only selected resources.Names of resources to select.
DltSource - Cloned source with selected resources
Source: ~/workspace/source/dlt/extract/source.py:509
discover_schema()
Computes table schemas for all selected resources and merges them with the current schema.Data item for evaluating dynamic tables. If not provided, dynamic tables are ignored.
Additional metadata.
Schema - The discovered schema
Source: ~/workspace/source/dlt/extract/source.py:492
add_limit()
Limits the items processed in all selected resources by count or time.Maximum number of items to yield per resource.
Maximum seconds for each resource to run.
Count rows instead of pages. Last page will not be trimmed.
DltSource - Returns self for chaining
Source: ~/workspace/source/dlt/extract/source.py:532
parallelize()
Marks all resources to run in parallel.DltSource - Returns self for chaining
Source: ~/workspace/source/dlt/extract/source.py:563
decompose()
Decomposes source into a list of sources based on strategy.Strategy for decomposition: “none” or “scc” (strongly connected components).
List[DltSource] - List of decomposed sources
Source: ~/workspace/source/dlt/extract/source.py:515
clone()
Creates a deep copy of the source.New name for the cloned source. Also renames the schema.
DltSource - Cloned source
Source: ~/workspace/source/dlt/extract/source.py:589
run
Convenience property that callsrun() on the currently active pipeline.
SupportsPipelineRun - Partial function that runs the source
Source: ~/workspace/source/dlt/extract/source.py:576