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
Metadata
Release files for universal-converter 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| universal_converter-1.0.0.tar.gz | 26.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| universal_converter-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 54.0 kB
Release files / universal_converter-1.0.0.tar.gz
| Download URL | universal_converter-1.0.0.tar.gz |
|---|---|
| Size | 26.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
72e06f7163e7961a998027aba9efea081c6ad953c161781c8600bb5a84d1cf78
|
|
BLAKE2b-256 checksum How to use checksums |
dfe0011e6c58338fa843c3d0033146aca56df0a2e29a8386d8d06229fa23d756
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / universal_converter-1.0.0-py3-none-any.whl
| Download URL | universal_converter-1.0.0-py3-none-any.whl |
|---|---|
| Size | 27.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
240a4019e0281550ee509ba5835c020f07d4d63c7568643091bf5ea642b505e5
|
|
BLAKE2b-256 checksum How to use checksums |
48b3fcf62d46e92d28e44e8093f75d889f2e7da6a6d6bdc760f73e3312324e05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|