sif-parser 0.1.0

Complete implementation of the Structured Interchange Format (SIF) — parser, emitter, streaming protocol, packed binary encoding, and format conversion
Documentation
  • Coverage
  • 41.92%
    109 out of 260 items documented0 out of 74 items with examples
  • Size
  • Source code size: 223.67 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 15.26 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 14s Average build duration of successful builds.
  • all releases: 14s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • scalecode-solutions

sif-parser

A complete, standalone implementation of the Structured Interchange Format (SIF) v1 -- parser, emitter, streaming protocol, packed binary encoding, and format conversion. Zero external dependencies.

Features

  • Parsing -- parse SIF documents with full support for schemas, blocks, templates, sections, inline annotations, and CDC operations.
  • Emitting -- produce well-formed SIF output from Document values.
  • Streaming -- SIF Streaming Protocol v1 with multiplexing, schema evolution, flow control, and heartbeat.
  • Packed binary -- compact binary encoding for SIF data.
  • Format conversion -- convert between SIF and JSON, JSONL, and CSV.
  • Type inference -- infer schemas and types from untyped data.

Quick Example

use sif_parser::{parse, Document};

let input = "\
#schema | id:int | name:str | active:bool
1 | alice | true
2 | bob   | false
";

let doc: Document = parse(input).unwrap();
assert_eq!(doc.blocks.len(), 1);
assert_eq!(doc.blocks[0].records.len(), 2);

Independence from forma

This crate is a standalone SIF parser with no dependency on the forma serialization framework. It can be used on its own wherever SIF parsing or generation is needed. The forma_sif crate builds on top of this one to provide forma trait integration.

License

Licensed under the MIT License.