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
Documentvalues. - 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 ;
let input = "\
#schema | id:int | name:str | active:bool
1 | alice | true
2 | bob | false
";
let doc: Document = parse.unwrap;
assert_eq!;
assert_eq!;
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.