datamorph-rs-0.1.2 has been yanked.
datamorph-rs
A powerful Rust library for transforming data structures using declarative specifications with JSONLogic support. Built for performance, type safety, and extensibility.
Overview
datamorph-rs allows you to transform data structures using simple array-based specifications with JSONLogic conditions. It's designed to be easy to use while remaining flexible and extensible.
Features
- 🚀 Simple, array-based transformation specifications
- 🔧 Built-in transformation functions
- 🎯 Type-safe transformations
- 🔄 Field, concatenation, and split operations
- ⚡ Conditional transformations with JSONLogic
- 📝 Clear error messages
Quick Start
Add to your Cargo.toml:
[]
= "0.1.0"
= "1.0"
Basic example:
use Datamorph;
use json;
// Define your transformation spec
let spec = r#"[
{
"type": "field",
"source": "name",
"target": "fullName",
"transform": "uppercase",
"condition": {
"!!": {"var": "name"}
}
},
{
"type": "concat",
"sources": ["city", "country"],
"target": "location",
"separator": ", "
}
]"#;
// Create transformer
let transformer = from_json?;
// Transform data
let input = json!;
let result: Value = transformer.transform?;
println!;
Documentation
- Usage Guide - Detailed usage instructions
- API Reference - Complete API documentation
- Examples - Example implementations
Contributing
Contributions are welcome! Please read our Contributing Guide for details.
License
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.