PyBeamGuard
Catch Apache Beam, Flink, and Spark pipeline failures before deployment — offline static analysis for reliability risks, hot keys, expensive shuffles, and rough cost forecasts.
Not to be confused with PyAirflowTester: PyBeamGuard analyzes Apache Beam/Dataflow pipelines; PyAirflowTester targets Airflow and dbt.
Which project do I need?
Part of the Mullassery open-source family. These tools have similar names — here is the short version of who does what:
| If you need to… | Use |
|---|---|
| Build a repository's dependency graph and match it against vulnerability advisories (Python, Rust, Node, containers) | PyDeepMesh |
| Understand why a Python dependency exists, who added it, and whether it is actually used | PyDependencyCheck |
| Statically analyze a dbt project (risky tests, test blast radius, cost) | PyDBTGuard |
| Statically analyze Apache Beam / Dataflow pipelines (cost, hot keys, reliability) | PyBeamGuard |
| Validate Airflow DAGs and dbt runs | PyAirflowTester |
| Simulate cascading-failure blast radius across infrastructure, data pipelines, and AI systems | PyBlastRadius |
| Check the quality of the data itself at runtime (schema, drift, anomalies) | StatGuardian |
| Discover devices, services, and vulnerabilities on a network | PyNetworkIntel |
| Discover and score API security risk (real traffic, agent/MCP, Cedar policy) | PyAPICheck |
| Trace and root-cause AI agent failures | PyAgentHound |
| Diagnose RAG retrieval failures | PyVectorHound |
| Orchestrate local, dependency-aware tasks (DAG scheduler + content-addressed cache) | PyTaskWireCheck |
What it is
PyBeamGuard is a static analysis platform for data pipelines. Point it at a
pipeline source file and it extracts the pipeline graph and runs a set of
analyzers over it, reporting findings with severities, a health score, and a
rough cost estimate. It is built as a Rust core with Python bindings (PyO3), and
ships both as a pip install-able package and as a standalone Rust CLI binary
with no Python runtime.
It works offline, needs no cloud account, and uses no vendor services. The analysis is regex/line-based over the source — it is a fast heuristic pre-flight check, not a full AST/type-level compiler front end.
Features / Highlights
- 10 Apache Beam analyzers: graph intelligence, hot key detection, shuffle analysis, windowing validation, state auditing, cost intelligence, reliability analysis, best-practices checks, deployment auditing, and architecture review.
- First-class Flink analyzers (
--framework flink): checkpointing (FlinkCheckpointAnalyzer), state-backend choice (FlinkStateAnalyzer), and watermark/windowing correctness (FlinkWatermarkAnalyzer). - First-class Spark analyzers (
--framework spark): shuffle partitioning (SparkShuffleAnalyzer), join/broadcast strategy (SparkJoinAnalyzer), and Structured Streaming safety (SparkStreamingAnalyzer). - Configurable rule engine (YAML): override hot-key keyword patterns,
cardinality/size thresholds, and cost rates via
--rules rules.yaml(Beam and Spark only); any field you omit keeps its built-in default. - CI gating:
--fail-on <severity>exits non-zero when any finding meets or exceeds the given severity. - Data-profile-aware estimates:
--data-profile profile.jsonreplaces some flat per-operation guesses with your throughput/state figures. - Two report formats: human-readable text (default) and machine-readable JSON.
- Dual distribution: a PyPI package (
pip install pybeamguard) and a standalone Rust binary from GitHub Releases.
Who it's for / Use cases
- Data engineers validating a pipeline before it ships: "will this scale, and roughly what will it cost?"
- Platform teams adding a pre-deployment gate to CI/CD with
pybeamguard analyze pipeline.py --fail-on critical. - FinOps teams attributing spend to specific stages by inspecting the
CostAnalyzermetrics in JSON output. - Anyone porting between engines who wants a comparable set of reliability checks across Beam, Flink, and Spark.
What it is not
- Not a pipeline runner or deployment tool. It reads source code; it never executes, deploys, or mutates your pipeline.
- Not a full compiler/AST analyzer. Analysis is regex/line-based over the pipeline source, so it is fast but can miss constructs a real parser would understand.
- Not a validated billing forecast. Cost figures are rough, pre-deployment heuristics from simplified pricing assumptions — treat them as an order-of-magnitude planning signal, not a quote.
- Not a directory scanner (yet).
analyzetakes a single pipeline file; scanning a directory means looping over files in your shell/CI. - No Kafka Streams or Ray Data support — neither has been started.
- No LLM features. All analysis and recommendations are deterministic rules.
- Not organization governance tooling. Budgets/SLOs/policy enforcement and audit logging were deliberately removed rather than left as untested stubs.
Project status
Beta / working proof-of-concept. The Beam, Flink, and Spark analysis paths, the CLI, the Python bindings, and the YAML rule engine are implemented and covered by tests, and CI builds and tests the core crate. See ROADMAP_HONEST.md for a blunt, file:line-level accounting of what is tested, what is not built, and known technical debt.
Installation
Requires Python 3.10+ for the PyPI package.
pip install pybeamguard
# or, with uv:
uv pip install pybeamguard
pybeamguard --version
Standalone Rust binary (no Python required) — download the artifact for your platform from the releases page:
chmod +x pybeamguard-macos-universal # or the linux/windows artifact
./pybeamguard-macos-universal --version
From source (Rust 1.70+ and Python 3.10+):
git clone https://github.com/Mullassery/PyBeamGuard.git
cd PyBeamGuard
# Python package via PyO3 bindings, installed into your active venv:
pip install maturin
maturin develop
# OR the standalone Rust CLI binary (no Python involved):
cargo build --release --bin pybeamguard
./target/release/pybeamguard --version
Quick start
# Text report (default)
pybeamguard analyze pipeline.py
# JSON report
pybeamguard analyze pipeline.py --format json
# Fail CI on any critical finding
pybeamguard analyze pipeline.py --fail-on critical
Example output shape:
=== PyBeamGuard Analysis Report ===
Pipeline Health Score: 78/100
Total Findings: 5
HIGH PRIORITY ISSUES
• Large shuffle stage in join operation
• Missing dead-letter queue on parse failures
Estimated Cost: $2,300/month → Optimized: $1,350/month
Usage
-
Analyze a Flink job:
pybeamguard analyze streaming_job.py --framework flink
-
Analyze a Spark job:
pybeamguard analyze etl.py --framework spark
-
Override analyzer thresholds/patterns:
# rules.yaml — every section/field is optional; omitted fields keep defaults. hotkey: high_risk_patterns: ["customer", "tenant", "region"] low_cardinality_threshold: 500 cost: worker_machine_cost_per_hour: 0.42 spark_join: broadcast_threshold_high_risk_bytes: 536870912 state: large_measured_state_size_gb: 250.0
pybeamguard analyze pipeline.py --rules rules.yaml
-
Use a data profile:
pybeamguard analyze pipeline.py --data-profile profile.json --format json
-
Scan a directory of pipelines in CI (single-file tool, so loop over files):
for f in pipelines/*.py; do pybeamguard analyze "$f" --fail-on critical || exit 1 done
For all subcommands and flags, run pybeamguard --help. The same analyze
surface is available from the Python bindings (analyze, analyze_spark,
get_json_report, get_text_report, analyze_structured, ...), which accept an
optional rules_yaml string.
Documentation
- ROADMAP_HONEST.md — verified status: what's tested, what isn't built, known CI gaps, and technical debt with file:line specifics.
- CONTRIBUTING.md — project layout, local setup, and the exact commands CI runs.
- SECURITY.md — how to report a vulnerability.
- CHANGELOG.md — notable changes (Keep a Changelog format).
- docs/archive/BUILD_SUMMARY.md — historical phase implementation notes.
Contributing
Contributions are welcome — see CONTRIBUTING.md for layout, setup, and the exact CI commands. Quick version:
cargo build --release --bin pybeamguard # standalone CLI binary
cargo test -p pybeamguard-core # Rust unit + integration tests
cargo fmt --all -- --check
cargo clippy --workspace -- -D warnings
pip install maturin pytest
maturin develop
pytest tests/ # Python binding/CLI tests
Note: scope plain cargo build/cargo test to -p pybeamguard-core. The
bindings/python crate declares pyo3's extension-module feature
unconditionally and only links correctly under maturin.
License
This project is licensed under the Apache License 2.0.
Metadata
Release files for pybeamguard 1.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pybeamguard-1.2.2.tar.gz | 88.6 kB | Without provenance | Details for pybeamguard-1.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pybeamguard-1.2.2-cp311-abi3-macosx_11_0_arm64.whl | CPython 3.11 | abi3 | macOS 11.0+ ARM64 | Details for pybeamguard-1.2.2-cp311-abi3-macosx_11_0_arm64.whl |
Total release size: 1.3 MB
Release files / pybeamguard-1.2.2.tar.gz
| Download URL | pybeamguard-1.2.2.tar.gz |
|---|---|
| Size | 88.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f013385f7b6f5bb7aaa3e597fdca4274dd25173e70d8a520d248c6c8d23970a4
|
|
BLAKE2b-256 checksum How to use checksums |
a65ebd7c1f1d4034cd9b5986a3bd938ca0c1ab9c8541d9b32cea3ed869b60fe1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / pybeamguard-1.2.2-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | pybeamguard-1.2.2-cp311-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.11 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
127d15e410a79b36cc433be0a60b58b7b6787764ead7e78c02860f01cd46fefe
|
|
BLAKE2b-256 checksum How to use checksums |
079533dea4a9b0fe3e58272e2afbc019883aa0a3b1be616af3f989d41de35c58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Security for pybeamguard 1.2.2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.