Use this file to discover Exa products, pricing, evaluations, comparisons, use cases, agent interfaces, and technical documentation before exploring further.
Python ETL libraries extract data from source systems, transform it, and load it into a warehouse or data lake. A loader tracks which records it has already moved and updates the destination schema when the source adds fields. These libraries let data teams keep warehouses and analytics tables in sync with production systems.
Popularity
PySpark has the most monthly downloads in this comparison, at 48.4M, a count that covers all Spark work.
def configure_spark(spark_session_builder, args):
"""Applies configuration to a ``SparkSession.Builder`` object.
Call :func:`add_configure_spark_arguments` to add command line arguments to the argparser object.
This function returns the ``SparkSession.Builder`` to allow chaining additional calls to the ``Builder``.
>>> from pyspark.sql import SparkSession
>>>
>>> arg_parser = argparse.ArgumentParser()
>>> add_configure_spark_arguments(arg_parser)
>>> # ... more argparse arguments
>>> args = arg_parser.parse_args()
>>> spark = configure_spark(SparkSession.builder.appName('petastorm-copy'), args).getOrCreate()
:param spark_session_builder: An instance of the ``pyspark.sql.session.SparkSession.Builder`` object.
:param args: A value returned by ``argparser.ArgumentParser.parse_args()`` call.
:return: ``SparkSession.Builder`` object.
"""
if 'spark_session_config' not in args or 'master' not in args:
raise RuntimeError('--spark-session-config and/or --master were not found in parsed arguments. '
'Call add_configure_spark_arguments() to add them.')
spark_session_config = _cli_spark_session_config_to_dict(args.spark_session_config)
for key, value in spark_session_config.items():
spark_session_builder.config(key, value)
if args.master:
spark_session_builder.master(args.master)
return spark_session_builder
Dagster
Orchestrates the development, production, and observation of data assets.
@dg.asset(
group_name="raw_files",
kinds={"python"},
)
def taxi_zones_file() -> dg.MaterializeResult:
"""The raw CSV file for the taxi zones dataset. Sourced from the NYC Open Data portal."""
raw_taxi_zones = requests.get(
"https://community-engineering-artifacts.s3.us-west-2.amazonaws.com/dagster-university/data/taxi_zones.csv"
)
with open(
constants.TAXI_ZONES_FILE_PATH, "wb", transport_params=smart_open_config
) as output_file:
output_file.write(raw_taxi_zones.content)
num_rows = len(pd.read_csv(BytesIO(raw_taxi_zones.content)))
return dg.MaterializeResult(
metadata={"Number of records": dg.MetadataValue.int(num_rows)}
)
@flow(name="Update ABC Snowflake Table", retries=2, retry_delay_seconds=900)
def abc_elt_flow(deptCode_list: List[int]) -> None:
"""Flow which
1. Calculates the last successful load of data into Snowflake in order
to set the correct start_time.
2. Extracts the data since the start_time from ABC API into a df.
3. If new data from ABC API, loads df into Snowflake table.
Args:
- deptCode_list: A list of dept IDs each referenced as a
deptCode.
"""
target_table = "ABC_TABLE"
start_tms = get_start_time(target_table)
df = extract_data_from_api(start_tms, deptCode_list)
if isinstance(df, DataFrame):
# clean column names for Snowflake df.columns = [col.replace(".", "_").upper() for col in df.columns]
# create ddl ddl = "".join([col + " STRING, " for col in df.columns])[:-2]
load_data_into_snowflake(df, target_table, ddl)
dlt
Loads Python data into typed destination tables with incremental state and schema controls.
Downloads / mo
6.7M
Stars
6.1K
Last release
1.32.0
License
Apache-2.0
Strengths
Tracks incremental loading state.Use cursor fields and merge strategies to load new or changed records.
Controls schema changes during loading.Evolve schemas or reject and discard data through explicit schema contracts.
Limitations
Replacing data can reset progress.The replace shorthand reloads data and resets the incremental cursor.
Frozen contracts can block loads.Freeze mode raises an exception when incoming data violates the existing schema.
def _run(
self,
context: OpExecutionContext | AssetExecutionContext,
dlt_source: DltSource,
dlt_pipeline: Pipeline,
dagster_dlt_translator: DagsterDltTranslator,
**kwargs,
) -> Iterator[DltEventType]:
"""Runs the dlt pipeline with subset support.
Args:
context (Union[OpExecutionContext, AssetExecutionContext]): Asset or op execution context
dlt_source (Optional[DltSource]): optional dlt source if resource is used from an `@op`
dlt_pipeline (Optional[Pipeline]): optional dlt pipeline if resource is used from an `@op`
dagster_dlt_translator (Optional[DagsterDltTranslator]): optional dlt translator if resource is used from an `@op`
**kwargs (dict[str, Any]): Keyword args passed to pipeline `run` method
Returns:
DltEventIterator[DltEventType]: An iterator of MaterializeResult or AssetMaterialization
"""
asset_key_dlt_source_resource_mapping = {
dagster_dlt_translator.get_asset_spec(
DltResourceTranslatorData(resource=dlt_source_resource, pipeline=dlt_pipeline)
).key: dlt_source_resource
for dlt_source_resource in dlt_source.selected_resources.values()
}
# Filter sources by asset key sub-selection if context.is_subset:
asset_key_dlt_source_resource_mapping = {
asset_key: asset_dlt_source_resource
for (
asset_key,
asset_dlt_source_resource,
) in asset_key_dlt_source_resource_mapping.items()
if asset_key in context.selected_asset_keys
}
dlt_source = dlt_source.with_resources(
*[
dlt_source_resource.name
for dlt_source_resource in asset_key_dlt_source_resource_mapping.values()
if dlt_source_resource
]
)
# Dlt keeps some local state that interferes with next runs. # This is annoying when an asset fails and running a different one on the same pipeline # would just pick up the failing job and fail again. # When restore_from_destination is enabled (default), we can safely drop all local state # because it will be restored from the destination. # When restore_from_destination is disabled, we only drop pending packages to avoid # wiping incremental loading cursors that can't be recovered from the destination. if dlt_pipeline.config.restore_from_destination:
dlt_pipeline.drop()
else:
dlt_pipeline.drop_pending_packages()
load_info = dlt_pipeline.run(dlt_source, **kwargs)
load_info.raise_on_failed_jobs()
has_asset_def: bool = bool(context and context.has_assets_def)
for (
asset_key,
dlt_source_resource,
) in asset_key_dlt_source_resource_mapping.items():
metadata = self.extract_resource_metadata(
context, dlt_source_resource, load_info, dlt_pipeline
)
if has_asset_def:
yield MaterializeResult(asset_key=asset_key, metadata=metadata)
else:
yield AssetMaterialization(asset_key=asset_key, metadata=metadata)
Apache Airflow
Authors, schedules, and monitors data pipelines in code.
from datetime import datetime
from airflow.sdk import DAG
from airflow.providers.standard.operators.empty import EmptyOperator
with DAG('first_pipeline', start_date=datetime(2024, 1, 1), schedule=None):
EmptyOperator(task_id='first_task')
def create_task_groups_based_on_folder(
dag: DAG,
node: DbtNode,
parent_task_group: TaskGroup | None,
task_groups: dict[str, TaskGroup],
use_hierarchical_naming: bool = False,
) -> TaskGroup | None:
"""
Generate the parent task group for the given node based on the node's file path. If a TaskGroup is given, it will
be used as the parent group.
When ``use_hierarchical_naming`` is True, groups are cached by their cumulative folder path, so that folders
sharing a leaf name under different parents (e.g. ``staging/aurora`` and ``marts/aurora``) become distinct task
groups instead of collapsing into the first one created. When False (default), groups are cached by the bare
folder name, preserving the legacy behaviour — and the existing task-group ids that users may reference — at the
cost of collapsing same-named folders. See https://github.com/astronomer/astronomer-cosmos/pull/2824.
"""
task_group = None
# Use ``Path.parts`` (OS-agnostic) rather than ``str(path).split("/")`` so folder grouping also # works on Windows, where ``str(Path(...))`` uses backslash separators. resource_file_path_parts = Path(node.original_file_path).parts[:-1]
cumulative_path = ""
for resource_file_path_part in resource_file_path_parts:
cumulative_path = f"{cumulative_path}/{resource_file_path_part}" if cumulative_path else resource_file_path_part
cache_key = cumulative_path if use_hierarchical_naming else resource_file_path_part
if cache_key in task_groups:
task_group = task_groups[cache_key]
else:
task_group = TaskGroup(dag=dag, group_id=resource_file_path_part, parent_group=parent_task_group)
task_groups[cache_key] = task_group
parent_task_group = task_group
return task_group
Apache Beam
Defines data-processing pipelines over bounded batches or unbounded collections using execution runners.
Downloads / mo
3.8M
Stars
8.7K
Last release
2.77.0
License
Apache-2.0
Strengths
Processes unbounded data streams.Use continuously running pipelines with streaming sources and sinks.
Builds distributed processing graphs.Compose transforms over distributed collections and select an execution runner.
Limitations
Unbounded grouping needs windowing.Configure non-global windows or aggregation triggers before grouping unbounded collections.
Retries can repeat side effects.Make external side effects idempotent when a transform can run again.
def expand(
self,
pipeline: beam.Pipeline) -> beam.pvalue.PCollection[tf.train.Example]:
logging.info('Processing input csv data %s to TFExample.',
self._csv_pattern)
csv_files = fileio.glob(self._csv_pattern)
if not csv_files:
raise RuntimeError('Split pattern {} does not match any files.'.format(
self._csv_pattern))
column_names = io_utils.load_csv_column_names(csv_files[0])
for csv_file in csv_files[1:]:
if io_utils.load_csv_column_names(csv_file) != column_names:
raise RuntimeError(
'Files in same split {} have different header.'.format(
self._csv_pattern))
# Read each CSV file while maintaining order. This is done in order to group # together multi-line string fields. parsed_csv_lines = (
pipeline
| 'CreateFilenames' >> beam.Create(csv_files)
| 'ReadFromText' >> beam.ParDo(_ReadCsvRecordsFromTextFile())
| 'ParseCSVLine' >> beam.ParDo(csv_decoder.ParseCSVLine(delimiter=','))
| 'ExtractParsedCSVLines' >> beam.Keys())
column_infos = beam.pvalue.AsSingleton(
parsed_csv_lines
| 'InferColumnTypes' >> beam.CombineGlobally(
csv_decoder.ColumnTypeInferrer(column_names, skip_blank_lines=True))
)
return (parsed_csv_lines
|
'ToTFExample' >> beam.ParDo(_ParsedCsvToTfExample(), column_infos))
Kedro
Organizes reusable Python nodes, dependencies, and data catalog entries into reproducible pipelines.
Downloads / mo
1.5M
Stars
11.1K
Last release
1.8.0
License
Apache-2.0
Strengths
Resolves dependencies between Python functions.Describe node inputs and outputs, then let the pipeline determine execution order.
Validates catalog data at boundaries.Reject invalid inputs before processing and invalid outputs before storage.
Limitations
Parallel execution needs shared catalogs.Use SharedMemoryDataCatalog with ParallelRunner when calling the Python API.
Async dataset access needs thread-safety.Use thread-safe datasets when enabling asynchronous loading and saving.
def _check_consistency(self) -> None:
inference_parameters = {
input for input in self.inference.inputs() if input.startswith("params:")
}
free_inputs_set = (
self.inference.inputs()
- {self.input_name}
- self.all_outputs()
- self.inputs()
- inference_parameters # it is allowed to pass parameters: they will be automatically persisted by the hook
)
if len(free_inputs_set) > 0:
input_set_txt = "\n - ".join(free_inputs_set)
raise KedroMlflowPipelineMLError(
"The following inputs are free for the inference pipeline:\n"
f" - {input_set_txt}."
" \nNo free input is allowed."
" Please make sure that 'inference.inputs()' are all"
" in 'training.all_outputs() + training.inputs()'"
"except 'input_name' and parameters which starts with 'params:'."
)
Luigi
Manages workflows, schedules tasks, and resolves dependencies.
@staticmethod
def get_object_storage_target(path: str, format: Format) -> luigi.target.FileSystemTarget:
if path.startswith('s3://'):
try:
import boto3 # noqa: F401 # pyright: ignore[reportUnusedImport]
except ImportError:
raise ImportError('S3 support requires additional dependencies. Install them with: pip install gokart[s3]') from None
import luigi.contrib.s3
from gokart.s3_config import S3Config
return luigi.contrib.s3.S3Target(path, client=S3Config().get_s3_client(), format=format)
elif path.startswith('gs://'):
try:
import googleapiclient # noqa: F401 # pyright: ignore[reportUnusedImport]
except ImportError:
raise ImportError('GCS support requires additional dependencies. Install them with: pip install gokart[gcs]') from None
import luigi.contrib.gcs
from gokart.gcs_config import GCSConfig
return luigi.contrib.gcs.GCSTarget(path, client=GCSConfig().get_gcs_client(), format=format)
else:
raise
FAQ
dlt suits loading API and database data into typed warehouse tables with incremental state. PySpark suits transformations over data too large for one machine. Dagster, Prefect, and Apache Airflow suit scheduling the pipeline steps.
PySpark is the Python API for Apache Spark, the distributed data processing engine.
Kedro organizes reusable Python nodes, their dependencies, and data catalog entries into reproducible data and analytics pipelines.
dlt is an open-source Python library that loads data into typed destination tables. It keeps incremental state and schema controls and needs no backend to run.
Luigi is a Python package for workflow management, task scheduling, and dependency resolution.
For coding agents
Found your ETL library? Help your agent use it.
Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.