a domain-specific language (DSL) for building data processing pipelines.
It lets you describe operations like filtering, grouping, aggregation, and output in a clean, human-readable .dpl??.flow file.
The interpreter, written in Rust, parses the DSL into an AST and executes it directly using Polars.
- Custom DSL File Type:
.dplfor declarative data pipelines. - Interpreter in Rust: Parses DSL → AST → executes directly.
- Data Sources: CSV and JSON.
- Operations:
source– load datafilter– apply row conditionsgroup by– group dataaggregate– compute metricsoutput– write results
- Command-Line Tool:
dpl main.dpl– run a pipelinedpl repl– interactive modedpl explain main.dpl– print parsed AST
sales.dpl:
csv <- "sales.csv"
filter(where amount > 1000)
group by region
aggregate(sum(amount) as total_sales)
output -> "report.json"
This pipeline:
- Loads
sales.csv - Filters rows where
amount > 1000 - Groups data by
region - Aggregates
amountintototal_sales - Writes the result to
report.json
report.json:
[
{ "region": "North", "total_sales": 124000 },
{ "region": "South", "total_sales": 89000 }
]Build the binary with Cargo:
cargo build --releaseMove the binary to your PATH:
cp target/release/dpl ~/.cargo/bin/Now you can run DPL from anywhere:
dpl main.dplRun a .dpl pipeline:
dpl main.dplStart an interactive REPL:
dpl replDebug/inspect the parsed AST:
dpl explain main.dpldpl/
├── Cargo.toml
├── src/
│ ├── main.rs # CLI entry point
│ ├── parser/ # DSL parser (Pest/Nom grammar)
│ ├── ast.rs # AST definitions
│ ├── interpreter.rs # Interpreter engine
│ ├── errors.rs # Custom error types
│ └── utils.rs # Helper functions
├── examples/
│ └── sales_pipeline.dpl
└── README.md
- Expressions (
amount * 1.1, derived columns). - More file formats (Parquet, Excel).
- Built-in functions (mean, median, variance).
- Better error reporting with line/column context.
- Optimizations: merge filters, lazy evaluation.
MIT License © 2025 sparrowsaurora
(Back to Top) `