Expand description
§AnyRepair
A Rust crate for repairing malformed structured data including JSON, YAML, XML, TOML, CSV, INI, Markdown, and Diff with format auto-detection.
Re-exports§
pub use diff::DiffRepairer;pub use error::RepairError;pub use error::Result;pub use json::JsonRepairer;pub use key_value::EnvRepairer;pub use key_value::IniRepairer;pub use key_value::PropertiesRepairer;pub use mcp_server::AnyrepairMcpServer;pub use streaming::StreamingRepair;pub use traits::Repair;
Modules§
- csv
- CSV repair module
- diff
- Diff/Unified diff repair module
- error
- Error types for the anyrepair crate
- format_
detection - Format detection heuristics
- json
- JSON repair module
- json_
util - Minimal JSON helpers (validation, escaping, MCP payloads) without serde.
- key_
value - Key-value format repair module (INI, .env, .properties)
- markdown
- Markdown repair module
- mcp_
server - MCP (Model Context Protocol) server for anyrepair
- repairer_
base - Generic repair loop: validator gate + ordered
RepairStrategypipeline. - streaming
- Streaming repair for large files with minimal memory overhead
- toml
- TOML repair module
- traits
- Core traits for repair functionality
- xml
- XML repair module
- yaml
- YAML repair functionality
Constants§
- SUPPORTED_
FORMATS - All format identifiers supported by anyrepair.
Used by
create_repairer,create_validator, andrepair_with_format.
Functions§
- create_
repairer - Create a boxed
Repairinstance for the given format. Accepts canonical names and aliases (e.g.yml,md). ReturnsRepairError::FormatDetectionif the format is unknown. - create_
validator - Create a boxed
Validatorfor the given format. Accepts canonical names and aliases (e.g.yml,md). ReturnsRepairError::FormatDetectionif the format is unknown. - detect_
format - Detect the format of the given content.
Returns
Noneif no known format matches. Seeformat_detectionfor the heuristic order. - jsonrepair
- Repair a JSON string (Python-compatible convenience function).
Equivalent to
create_repairer("json")?.repair(json_str). - normalize_
format - Normalize a format alias to its canonical name.
Accepts case-insensitive matches and common aliases (
yml→yaml,md→markdown). Returns the original string unchanged if no match is found. - repair
- Repair content with automatic format detection. Falls back to the Markdown repairer if no format is detected.
- repair_
with_ explanations - Repair content with a specific format and return the list of strategies that changed it.
Returns
(repaired_content, applied_strategy_names). - repair_
with_ format - Repair content using an explicit format.
Convenience wrapper around
create_repairer+Repair::repair.