tpt-data-parsers
RustUltra-fast, zero/low-allocation Rust parsers for niche data formats (JSONL, GeoJSON, logfmt, cron, MIME).
0 stars0 forks0 watchers1 open issues
Languages
Rust100.0%
README
tpt-data-parsers
A Rust workspace of ultra-fast, zero-allocation parsers for formats the broader ecosystem ignores.
Each crate is published independently to crates.io and is
designed to be dropped into a pipeline, a log shipper, or a constrained
(no_std) target without pulling in a heavy dependency tree.
Crates
| Crate | Description | crates.io | docs.rs |
|---|---|---|---|
tpt-jsonl-stream | Streaming, zero-allocation JSON Lines parser | ||
tpt-geo-geojson | Strict, validating GeoJSON parser with line-numbered errors | ||
tpt-logfmt-parse | Zero-copy logfmt (key=value) parser | ||
tpt-cron-parse | Cron expression parser with human-readable output | ||
tpt-mime-pure | Pure Rust MIME type detection via magic bytes (no_std) |
Which crate do I need?
- I have newline-delimited JSON (
.jsonl/ NDJSON) and want to iterate records without loading everything into memory →tpt-jsonl-stream. - I have GeoJSON and need strict validation with precise error locations →
tpt-geo-geojson. - I'm parsing structured logs of the form
key=value key="quoted value"→tpt-logfmt-parse. - I have a cron schedule string and want a human-readable description or precise parse
errors →
tpt-cron-parse. - I need to identify a file's type from its bytes or extension (no
filebinary) →tpt-mime-pure.
If you only have a filename/path rather than raw bytes, tpt-mime-pure's
detect_by_extension is the right tool. If you have raw bytes, use detect.
Design principles
- Zero / low allocation where it matters — most crates parse without
allocating in the hot path (
tpt-logfmt-parse,tpt-jsonl-stream). - Minimal dependencies —
tpt-cron-parse,tpt-mime-pure, andtpt-logfmt-parsehave no runtime dependencies;tpt-jsonl-streamonly depends onserde_json(with an optionalsimdfast path). - Precise errors — parsers report byte positions, line numbers, or structure paths instead of opaque failures.
no_stdcapable —tpt-mime-pureworks without the standard library (itsstdfeature is default; disable it viadefault-features = false).
Workspace & contributing
- This is a Cargo workspace (
resolver = "2", edition 2021, MSRV 1.70). Shared metadata lives in the rootCargo.tomlviaworkspace = true; member crates must not hardcode it. - See
AGENTS.mdfor the exact verify/test/publish commands (cargo fmt/cargo clippy -D warnings/cargo test), and per-crate publishing onv*.*.*tags. CONTRIBUTING.mddocuments how to set up, the CI sequence to run locally, and the project conventions.- Each crate ships a runnable example under its
examples/directory (run withcargo run -p <crate> --example <name>).
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.