Skip to main content
Asgarde logo

Asgarde

PyPI Python versions CI Apache Beam uv Ruff Docs License: MIT GitHub stars

Error handling and dead letter queues for Apache Beam Python, without the boilerplate. Also available for Java and Kotlin with Asgarde Java.

📖 Documentation: https://tosun-si.github.io/asgarde/

Why Asgarde

With plain Beam, each step needs its own DoFn with a try/except block and tagged outputs, and all the failures must be flattened at the end. Asgarde keeps a fluent flow and gathers the failures of all the steps:

from asgarde import CollectionComposer

result = (CollectionComposer.of(values)
          .map('Trim', lambda value: value.strip())
          .map('Parse', int)
          .filter('Keep even numbers', lambda number: number % 2 == 0))

outputs = result.outputs    # Output of the last step
failures = result.failures  # The failures of all the steps, for your dead letter queue

Installation

Asgarde is published on PyPI. apache-beam is a minimum version, not a pin: your pipeline brings its own Beam version.

uv add asgarde      # or: pip install asgarde

Features

  • One place for all the errors: each step catches its errors in a Failure (with the stack trace), the CollectionComposer gathers the failures of all the steps.
  • map, flat_map and filter operators with side inputs and DoFn lifecycle actions, and Failure.from_exception for your own DoFn.
  • Origin element: with with_origin_element, the failures also give the element that entered the flow, to debug and replay from the start. Evaluated only when a failure occurs.
  • Never breaks your job: non picklable exceptions, non JSON dicts, partial flat_map outputs, deterministic labels for Dataflow updates.
  • Input element format and encoded elements: choose the string format of the input element (with_input_element_to_string), and optionally keep the elements encoded with their coder (with_encoded_elements), to replay them exactly.
  • Any Beam transform: apply(name, beam.Map(...)) or a custom DoFn, with the Beam native exception handling, its errors gathered with the other failures.
  • Write the failures to BigQuery with Failure.to_dict() and FAILURE_BIGQUERY_SCHEMA (exception type, message, stack trace, timestamp...).
  • Beam native error handling: the failures can be added to a Beam ErrorHandler with Failure.to_bad_record, for a single dead letter queue.
  • Failure metrics: a Beam counter per step.
  • Typed (py.typed).

Compatibility

Python 3.10 to 3.14, apache-beam>=2.60.0. The CI tests the minimum Beam version and the latest Beam release on every push and every week. See Compatibility.

Roadmap

See the roadmap.

Contributing

Contributions are welcome, see CONTRIBUTING.md.

License

MIT

Release files for asgarde 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asgarde 1.4.0
File Size Uploaded
asgarde-1.4.0.tar.gz 134.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for asgarde 1.4.0
File Interpreter ABI Platform
asgarde-1.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 147.8 kB

Release files / asgarde-1.4.0.tar.gz

Download URL asgarde-1.4.0.tar.gz
Size 134.4 kB
Tags Source
SHA-256 checksum
How to use checksums
50d72b95ed0552dbf5770585c558cbd10b75533696f2e9994431e08cf704c953
BLAKE2b-256 checksum
How to use checksums
28952c10924652ebcaa6c856457003b9a137e66bca5bac416296dc9e923a079c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release files / asgarde-1.4.0-py3-none-any.whl

Download URL asgarde-1.4.0-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cef9e51153e8c72d5b0af8874c626833b9f3a2f3e2aaf8c7fe51d89125c39e23
BLAKE2b-256 checksum
How to use checksums
fafdaa648d616acbd9f11543b1561486881ffd6698f573484d3e0098ab28ba8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.0.0

2 release files

0.16.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page