tpt-data-parsers

Rust

Ultra-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

CrateDescriptioncrates.iodocs.rs
tpt-jsonl-streamStreaming, zero-allocation JSON Lines parsercrates.iodocs.rs
tpt-geo-geojsonStrict, validating GeoJSON parser with line-numbered errorscrates.iodocs.rs
tpt-logfmt-parseZero-copy logfmt (key=value) parsercrates.iodocs.rs
tpt-cron-parseCron expression parser with human-readable outputcrates.iodocs.rs
tpt-mime-purePure Rust MIME type detection via magic bytes (no_std)crates.iodocs.rs

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 file binary) → 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 dependenciestpt-cron-parse, tpt-mime-pure, and tpt-logfmt-parse have no runtime dependencies; tpt-jsonl-stream only depends on serde_json (with an optional simd fast path).
  • Precise errors — parsers report byte positions, line numbers, or structure paths instead of opaque failures.
  • no_std capabletpt-mime-pure works without the standard library (its std feature is default; disable it via default-features = false).

Workspace & contributing

  • This is a Cargo workspace (resolver = "2", edition 2021, MSRV 1.70). Shared metadata lives in the root Cargo.toml via workspace = true; member crates must not hardcode it.
  • See AGENTS.md for the exact verify/test/publish commands (cargo fmt / cargo clippy -D warnings / cargo test), and per-crate publishing on v*.*.* tags.
  • CONTRIBUTING.md documents 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 with cargo run -p <crate> --example <name>).

License

Licensed under either of:

at your option.