anyrepair-0.1.1 has been yanked.
AnyRepair
A Rust crate for repairing LLM responses including JSON, YAML, Markdown, and XML.
Features
- Multi-format repair: JSON, YAML, Markdown, XML
- Auto-detection: Automatically detects format and applies appropriate repairs
- High performance: Regex caching with up to 99.6% performance improvement
- CLI tool: Command-line interface for easy usage
- Comprehensive testing: 65+ test cases with snapshot testing
Installation
[]
= "0.1.1"
Usage
Library
use repair;
// Auto-detect format and repair
let content = r#"{"name": "John", "age": 30,}"#;
let repaired = repair?;
println!; // {"name": "John", "age": 30}
CLI
# Install
# Repair a file
# Batch process
# Get statistics
Supported Formats
- JSON: Missing quotes, trailing commas, malformed numbers, boolean/null values
- YAML: Indentation, missing colons, list formatting, complex structures
- Markdown: Headers, code blocks, lists, tables, links, images
- XML: Unclosed tags, malformed attributes, missing quotes, invalid characters
License
Apache-2.0