Files
2025-11-29 18:26:08 +08:00

83 lines
1.8 KiB
Markdown

# data.transform
Transform data between different formats (JSON, YAML, XML, CSV) with validation and error handling
## Overview
**Purpose:** Transform data between different formats (JSON, YAML, XML, CSV) with validation and error handling
**Command:** `/data/transform`
## Usage
### Basic Usage
```bash
python3 skills/data/transform/data_transform.py
```
### With Arguments
```bash
python3 skills/data/transform/data_transform.py \
--input_file_path "value" \
--source_format "value" \
--target_format "value" \
--schema_path_(optional) "value" \
--output-format json
```
## Inputs
- **input_file_path**
- **source_format**
- **target_format**
- **schema_path (optional)**
## Outputs
- **transformed_file**
- **transformation_report.json**
## Artifact Metadata
### Produces
- `transformed-data`
- `transformation-report`
## Permissions
- `filesystem:read`
- `filesystem:write`
## Implementation Notes
Support transformations between: - JSON ↔ YAML - JSON ↔ XML - JSON ↔ CSV - YAML ↔ XML - XML ↔ CSV Features: - Validate input against schema before transformation - Preserve data types during conversion - Handle nested structures appropriately - Report data loss warnings (e.g., CSV can't represent nesting) - Support custom transformation rules - Provide detailed error messages Output report should include: - Transformation success status - Source and target formats - Data validation results - Warnings about potential data loss - Transformation time and file sizes
## Integration
This skill can be used in agents by including it in `skills_available`:
```yaml
name: my.agent
skills_available:
- data.transform
```
## Testing
Run tests with:
```bash
pytest skills/data/transform/test_data_transform.py -v
```
## Created By
This skill was generated by **meta.skill**, the skill creator meta-agent.
---
*Part of the Betty Framework*