Convert anything to anything - comprehensive file format conversion library
Project description
Universal Converter
A comprehensive Python library for converting between file formats, data types, and domain-specific formats.
Overview
Universal Converter provides a unified interface for hundreds of conversion operations across multiple domains:
- Data formats: JSON, CSV, XML, YAML, TOML, Parquet
- Documents: PDF, DOCX, Markdown, HTML, RTF
- Media: Images (PNG, JPG, WebP, TIFF), Audio (MP3, WAV, FLAC), Video (MP4, AVI, MKV)
- Scientific: Bioinformatics (FASTA, FASTQ, GenBank, VCF), GIS (GeoJSON, Shapefile, KML)
- ML/AI: PyTorch, ONNX, TensorFlow, Keras model formats
- Infrastructure: Terraform, Kubernetes manifests, cloud configs
Installation
pip install universal-converter
Install with specific extras for additional features:
pip install universal-converter[images] # Image processing
pip install universal-converter[audio] # Audio conversion
pip install universal-converter[video] # Video conversion
pip install universal-converter[ai] # ML model conversion
pip install universal-converter[database] # Database formats
pip install universal-converter[all] # All features
Architecture
The library follows a modular, plugin-based architecture:
universal_converter/
├── converters/ # Format-specific converters
│ ├── data.py # JSON, CSV, XML, YAML
│ ├── images.py # Image formats
│ ├── audio.py # Audio formats
│ ├── video.py # Video formats
│ ├── documents.py # Document formats
│ ├── ai.py # ML model formats
│ ├── cloud.py # Cloud configs
│ ├── bioinformatics.py
│ ├── gis.py
│ ├── network.py
│ └── database.py
└── utils/
└── platform.py # System utilities
All converters inherit from BaseConverter and implement a consistent interface.
Usage
Python API
from universal_converter import convert_file, resize_image
# Convert between data formats
convert_file('data.json', 'output.xml')
# Resize an image
resize_image('photo.png', 'thumb.png', width=200)
# Access specific converters directly
from universal_converter.converters import DataConverter, ImageConverter
converter = DataConverter()
result = converter.convert(task)
Command Line
# Convert a file
python -m universal_converter input.json -t csv -o output.csv
# List supported formats
python -m universal_converter -l
Supported Formats
| Category | Formats |
|---|---|
| Data | json, csv, xml, yaml, toml, parquet |
| Images | png, jpg, gif, bmp, tiff, webp |
| Audio | mp3, wav, flac, ogg, aac, m4a |
| Video | mp4, avi, mkv, mov, webm |
| Documents | pdf, docx, txt, html, md |
| ML Models | pt, h5, onnx, tflite, pkl |
| Bioinformatics | fasta, fastq, genbank, vcf, bed |
| GIS | shp, geojson, kml, gpx, tif |
| Database | sqlite, sql, xlsx |
Design Principles
- Lazy loading: Converters are loaded on-demand to minimize startup time
- Optional dependencies: Heavy dependencies are optional; the core works without them
- Clear error messages: Missing dependencies return actionable installation instructions
- Type hints: Full type annotations for IDE support
Requirements
- Python 3.9+
- Core dependencies installed automatically
License
MIT
Repository
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 universal_converter-1.0.0.tar.gz.
File metadata
- Download URL: universal_converter-1.0.0.tar.gz
- Upload date:
- Size: 26.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72e06f7163e7961a998027aba9efea081c6ad953c161781c8600bb5a84d1cf78
|
|
| MD5 |
fe8f960a54336a7992c349cf9b977213
|
|
| BLAKE2b-256 |
dfe0011e6c58338fa843c3d0033146aca56df0a2e29a8386d8d06229fa23d756
|
File details
Details for the file universal_converter-1.0.0-py3-none-any.whl.
File metadata
- Download URL: universal_converter-1.0.0-py3-none-any.whl
- Upload date:
- Size: 27.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
240a4019e0281550ee509ba5835c020f07d4d63c7568643091bf5ea642b505e5
|
|
| MD5 |
8c293dae49bd09f1e370c9b58355cfcd
|
|
| BLAKE2b-256 |
48b3fcf62d46e92d28e44e8093f75d889f2e7da6a6d6bdc760f73e3312324e05
|