Use Anthropic Claude to convert files
Project description
smartmutate
Smartmutate is a file conversion tool built in Python that leverages Anthropic's Claude API to intelligently convert data between common file types.
Features
- Supports for common data formats like JSON, CSV, YAML, and XML (more formats coming soon)
- Available as command-line interface and as a Python Library
- Built-in format validation and error handling
Installation
Install SmartMutate using pip:
pip install smartmutate
Quick Start
SmartMutate can be used either directly from the command line or as a Python library.
Command Line
Convert files directly from the terminal:
# Set your Anthropic API key
export ANTHROPIC_API_KEY='your-api-key'
# Convert a file
smartmutate input.json output.yaml
Python Library
Use the converter function in your Python code:
from smartmutate import Converter
# Initialize the converter
converter = Converter(api_key="your-anthropic-key")
# Convert a file
converter.convert_file("input.json", "output.yaml")
Supported Formats
SmartMutate currently supports conversions between:
- JSON
- YAML
- CSV
- TXT
- More formats coming soon...
Each format is validated before conversion to ensure data integrity.
Configuration
SmartMutate uses your Anthropic API key for conversions. You can provide it in several ways:
- Environment variable:
ANTHROPIC_API_KEY - Direct initialization:
Converter(api_key="your-key") - Command line argument:
--api-keyOR--envfollowed by the path to your.envfile
Error Handling
SmartMutate includes comprehensive error handling for:
- Invalid file formats
- Missing input files
- API connection issues
- Conversion failures
Each error provides clear feedback to help troubleshoot issues quickly.
Development
Running Tests
Run the test suite using pytest:
# Install development dependencies
pip install -e .[test]
# Run tests
pytest tests/
Contributing
We welcome contributions! To get started:
- Fork the repository
- Create a feature branch
- Make something cool or fix something bad
- Submit a pull request
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file smartmutate-1.0.1.tar.gz.
File metadata
- Download URL: smartmutate-1.0.1.tar.gz
- Upload date:
- Size: 49.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3dfd6f625c052fd41e02bc5e6f2b8e9675df04195d3c3a5f96cfc0c8c77d9feb
|
|
| MD5 |
8c5f1101a2557120d798ff7e582f49ff
|
|
| BLAKE2b-256 |
fb3a3b07d051026731d3c302f5d3abfc10a8b4d613e1636487ce0326d8d9a1cd
|
File details
Details for the file smartmutate-1.0.1-py3-none-any.whl.
File metadata
- Download URL: smartmutate-1.0.1-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2c415a83554e9772063618c4820be985f5ad20ece80e115e70308d7c40cfa4a
|
|
| MD5 |
392552ced87d98ba7f8e088e660dafc2
|
|
| BLAKE2b-256 |
db12f271b5d22d05c47a2726761a1d3f1baac23fb1681fcc249a9475c6011f88
|