babbel
The master facade crate for the Babbel multi-format serialization and document processing ecosystem. It provides unified ergonomics, re-exports all domain engines (JSON, YAML, XML, Bencode, CSV, TSV, INI, JSON Lines), and powers open-ended, $O(N)$ cross-format conversion pipelines.
Features
- Unified Prelude: Access all formats and text processing primitives with a single dependency.
- Polyglot Parsing: Parse JSON, YAML, XML, Bencode, CSV/TSV, and INI into idiomatic typed representations.
- Universal Cross-Conversion: Convert documents between 8 arbitrary formats without manual intermediate representations:
- JSON $\leftrightarrow$ YAML $\leftrightarrow$ XML $\leftrightarrow$ Bencode
- CSV / TSV $\leftrightarrow$ JSON $\leftrightarrow$ YAML
- INI / .env $\leftrightarrow$ JSON $\leftrightarrow$ YAML
- JSON Lines $\leftrightarrow$ JSON $\leftrightarrow$ CSV
- First-Class Text Processing:
- RFC 4180 CSV & TSV parsing/emission with automatic delimiter sniffing and scalar type inference.
- Section-based INI (
[section]), Java.properties, and.envparsing. - Line-delimited JSON (
.jsonl/.ndjson) streaming reader and writer. - Document frontmatter extraction (
split_frontmatterfor YAML---and TOML+++).
- Extensible Streaming I/O: Stream to and from files or memory buffers powered by
babbel_core. - Fine-Grained Feature Flags: Enable only the formats your application requires.
Installation
Add babbel to your Cargo.toml:
[]
= "0.1.2"
Or as a workspace path dependency:
[]
= { = "crates/babbel" }
Feature Flags
By default, all formats and the conversion pipeline are enabled (["std", "json", "yaml", "xml", "bencode", "convert"]). To minimize binary size, enable only what you need:
| Feature | Description |
|---|---|
std (default) |
Enables standard library I/O and OS integration. |
alloc |
Enables heap allocation without full std (no_std environments). |
json (default) |
Re-exports babbel_json for JSON parsing, pointers, patch, and JSON Lines streaming. |
yaml (default) |
Re-exports babbel_yaml for full YAML 1.2 parsing and emission. |
xml (default) |
Re-exports babbel_xml for validating XML DOM, C14N, and XPath 1.0. |
bencode (default) |
Re-exports babbel_bencode for BitTorrent Bencode processing. |
convert (default) |
Enables the babbel::convert cross-format conversion pipeline across all 8 formats. |
Quickstart
1. Document Parsing & Navigation
use json;
use yaml;
use xml;
use bencode;
use ;
2. Universal Cross-Format Conversions
use convert;
3. Streaming I/O
use ;
use xml;
Sub-Libraries
| Crate | Link | Description |
|---|---|---|
babbel_core |
crates/babbel_core |
Core I/O traits (ILineReader), universal Value AST, RFC 4180 CSV/TSV, INI/.env, frontmatter, BOM detection, and numeric utilities. |
babbel_json |
crates/json |
RFC 6901 JSON Pointer, RFC 7396 Merge Patch, JSON Lines (.jsonl/.ndjson) streaming, and JSON5 comment stripping. |
babbel_yaml |
crates/yaml |
YAML 1.2 specification compliance, anchors, aliases, and custom tags. |
babbel_xml |
crates/xml |
XML DOM, C14N Canonical XML, DTD validation, XSD schema, XPath 1.0. |
babbel_bencode |
crates/bencode |
Zero-copy borrowed parsing and streaming for BitTorrent Bencode. |
Documentation
See the Documentation Hub for full workspace guides:
- Architecture Guide
- Embedded Systems Guide
- Text Support Guide
- Conversion Matrix
- Development Guide
- Contributing Guidelines
License
Licensed under the MIT License.