Skip to main content

CLI tool for connecting to OpenConvert OpenAgents network for file conversion

Project description

๐Ÿ”„ OpenConvert CLI

Intelligent File Conversion for the Distributed Age

Python 3.8+ License: MIT PRs Welcome OpenAgents

Transform any file to any format using distributed AI agents

๐Ÿš€ Quick Start โ€ข ๐Ÿ“– Documentation โ€ข ๐Ÿค Contributing โ€ข ๐Ÿ’ฌ Community


๐ŸŒŸ What is OpenConvert?

OpenConvert CLI is a command-line tool that connects to distributed OpenAgents networks to discover and utilize file conversion services. Instead of installing multiple conversion tools, OpenConvert leverages distributed agents to handle various file conversion tasks.

โœ… Currently Implemented

๐Ÿ”— Network-Powered โ€ข Connect to OpenAgents conversion networks
๐Ÿค– Prompt Support โ€ข Use natural language prompts (agent-dependent)
๐Ÿ“ Batch Processing โ€ข Convert files and directories
๐Ÿ” Auto-Detection โ€ข Automatic MIME type detection
๐Ÿ›ก๏ธ Error Handling โ€ข Comprehensive error reporting
โšก Async Operations โ€ข Non-blocking network operations
๐Ÿ”ง Python API โ€ข Import and use from openconvert import convert
๐Ÿ“Š Format Discovery โ€ข --list-formats to see available conversions

๐Ÿšง Planned Features

๐Ÿš€ Enhanced Format Support โ€ข Expand to 50+ formats as agents join
๐Ÿณ Easy Deployment โ€ข Docker and Kubernetes support
โš™๏ธ Configuration Files โ€ข YAML config for defaults and preferences


๐ŸŽฌ See It In Action

# Convert a document with AI enhancement
openconvert -i data.csv -o report.pdf --prompt "Create a professional report with charts"

# Batch convert an entire photo library
openconvert -i photos/ -o pdfs/ --from image/jpeg --to application/pdf

# Simple format conversion
openconvert -i document.txt -o document.pdf

# Discover available conversions
openconvert --list-formats

๐Ÿ’ก Pro Tip: Use natural language prompts to guide conversions (depends on agent capabilities)!


๐Ÿš€ Quick Start

Installation

# Currently: Install from source
git clone https://github.com/openagents/openconvert.git
cd openconvert
pip install -e .

# Future: PyPI package (planned)
# pip install openconvert

Your First Conversion

# Start an OpenConvert network (one-time setup)
openagents launch-network demos/openconvert/network_config.yaml

# Launch some conversion agents
python demos/openconvert/run_agent.py doc &
python demos/openconvert/run_agent.py image &

# Convert your first file!
openconvert -i document.txt -o document.pdf

That's it! ๐ŸŽ‰

โš ๏ธ Current Status: This is an early-stage project. Basic functionality works, but many advanced features are still in development.


๐Ÿ“– Usage

Basic Syntax

openconvert -i INPUT -o OUTPUT [OPTIONS]

Real-World Examples

๐Ÿ“„ Document Conversions
# Text to PDF with custom styling
openconvert -i notes.txt -o notes.pdf --prompt "Use a professional layout with headers"

# Markdown to Word document
openconvert -i README.md -o README.docx

# CSV to formatted Excel with charts
openconvert -i sales.csv -o sales.xlsx --prompt "Add charts and formatting"
๐Ÿ–ผ๏ธ Image Processing
# Convert and compress images
openconvert -i photos/ -o thumbnails/ --from image/jpeg --to image/webp --prompt "Resize to 800px width"

# Create PDF from images
openconvert -i scans/ -o document.pdf --from image/png --to application/pdf

# Batch image format conversion
openconvert -i raw_images/ -o processed/ --from image/tiff --to image/png
๐ŸŽต Media Files
# Audio format conversion
openconvert -i music.wav -o music.mp3 --prompt "High quality encoding"

# Video format conversion
openconvert -i video.avi -o video.mp4 --prompt "Optimize for web streaming"

# Extract audio from video
openconvert -i movie.mp4 -o soundtrack.mp3
๐Ÿ—‚๏ธ Archives & Data
# Create compressed archives
openconvert -i project/ -o project.zip

# Convert between archive formats
openconvert -i backup.rar -o backup.tar.gz

# JSON to other formats
openconvert -i data.json -o data.xlsx --prompt "Create tables with proper headers"

Command-Line Options

Option Description Example
-i, --input Input file or directory -i documents/
-o, --output Output file or directory -o converted/
--from Source MIME type --from image/png
--to Target MIME type --to application/pdf
--prompt AI conversion instructions --prompt "Compress by 50%"
--host Network host --host remote.example.com
--port Network port --port 8765
-v, --verbose Detailed output -v
-q, --quiet Minimal output -q
--list-formats Discover available conversions --list-formats

๐ŸŒ Supported Formats

Category Formats Count
๐Ÿ“„ Documents txt, pdf, docx, html, md, rtf, csv, xlsx, epub 9+
๐Ÿ–ผ๏ธ Images png, jpg, gif, bmp, tiff, svg, webp, ico 8+
๐ŸŽต Audio mp3, wav, ogg, flac, aac, m4a 6+
๐ŸŽฌ Video mp4, avi, mkv, mov, webm, gif 6+
๐Ÿ—œ๏ธ Archives zip, rar, 7z, tar, gz, bz2 6+
๐Ÿ’ป Code json, xml, yaml, html, css, js, py 7+
๐ŸŽฏ 3D Models stl, obj, fbx, ply, glb 5+

Total: 50+ formats supported!

๐Ÿ“ˆ Growing Library: New formats added regularly as agents join the network


๐Ÿ—๏ธ Network Setup

Quick Network Setup

# 1. Clone the OpenAgents repository
git clone https://github.com/openagents/openagents.git
cd openagents

# 2. Start the network
openagents launch-network demos/openconvert/network_config.yaml

# 3. Launch conversion agents (in separate terminals)
python demos/openconvert/run_agent.py doc     # Document conversions
python demos/openconvert/run_agent.py image   # Image processing  
python demos/openconvert/run_agent.py audio   # Audio conversions
python demos/openconvert/run_agent.py video   # Video processing

Production Deployment (Planned)

๐Ÿšง Coming Soon: Docker and Kubernetes deployment configurations are being developed.

Currently: Use the manual setup method above for development and testing.


๐Ÿ”ง Advanced Usage

Batch Processing Power

# Convert all images in a folder structure
find ./photos -name "*.raw" -exec openconvert -i {} -o {}.jpg \;

# Parallel processing with xargs
ls *.txt | xargs -I {} -P 4 openconvert -i {} -o {}.pdf

# Directory-wide conversions
openconvert -i ./documents --from text/plain --to application/pdf --prompt "Professional formatting"

Python Integration

# Simple file conversion
from openconvert import convert_file

success = convert_file("document.txt", "document.pdf")
if success:
    print("โœ… Conversion successful!")

# Advanced batch conversion
from openconvert import convert
from pathlib import Path

success = convert(
    input_files=[Path("file1.txt"), Path("file2.txt")],
    output_path=Path("merged.pdf"),
    from_format="text/plain",
    to_format="application/pdf",
    prompt="Merge into single document with table of contents"
)

# Advanced async usage (for custom integrations)
from openconvert.client import OpenConvertClient

async def custom_conversion():
    client = OpenConvertClient()
    await client.connect("my-network.com", 8765)
    
    result = await client.convert_file(
        input_file=Path("data.xlsx"),
        output_file=Path("report.pdf"), 
        source_format="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
        target_format="application/pdf",
        prompt="Create executive summary with charts"
    )
    
    await client.disconnect()
    return result

Configuration Files (Planned)

๐Ÿšง Coming Soon: Configuration file support is planned for future releases.


๐Ÿ› ๏ธ Development

Project Structure

openconvert/
โ”œโ”€โ”€ ๐Ÿ“ openconvert/           # Main package
โ”‚   โ”œโ”€โ”€ ๐Ÿ __init__.py       # Package init
โ”‚   โ”œโ”€โ”€ ๐Ÿ–ฅ๏ธ openconvert_cli.py # CLI interface
โ”‚   โ”œโ”€โ”€ ๐ŸŒ client.py         # Network client
โ”‚   โ””โ”€โ”€ ๐Ÿ“„ __main__.py       # Module entry
โ”œโ”€โ”€ ๐Ÿงช tests/                # Test suite
โ”œโ”€โ”€ ๐Ÿ“– docs/                 # Documentation
โ”œโ”€โ”€ ๐Ÿณ docker/               # Docker configs
โ”œโ”€โ”€ โš™๏ธ setup.py              # Installation
โ””โ”€โ”€ ๐Ÿ“‹ README.md             # This file

Contributing Workflow

# 1. Fork & clone
git clone https://github.com/yourusername/openconvert.git
cd openconvert

# 2. Create feature branch
git checkout -b feature/amazing-feature

# 3. Set up development environment
pip install -e ".[dev]"
pre-commit install

# 4. Make changes & test
pytest tests/
black openconvert/
flake8 openconvert/

# 5. Submit PR
git push origin feature/amazing-feature

Running Tests

# Unit tests
pytest tests/

# Integration tests (requires network)
pytest tests/integration/ --network

# Performance tests
pytest tests/performance/ --benchmark

# Coverage report
pytest --cov=openconvert --cov-report=html

๐Ÿค Contributing

We โค๏ธ contributions! Here's how you can help:

๐Ÿ› Found a Bug?

  • Open an issue
  • Include reproduction steps
  • Mention your OS and Python version

๐Ÿ’ก Have an Idea?

๐Ÿ› ๏ธ Want to Code?

๐Ÿ“ Improve Documentation?

  • Fix typos or unclear sections
  • Add examples and tutorials
  • Translate to other languages

๐Ÿ’ฌ Community

Discord Twitter Follow GitHub Discussions


๐Ÿ—บ๏ธ Roadmap

๐Ÿš€ Coming Soon

  • Plugin System - Custom conversion agents
  • Web Interface - Browser-based UI
  • API Gateway - REST API for integrations
  • Cloud Hosting - Managed OpenConvert service
  • Mobile Apps - iOS and Android clients

๐ŸŽฏ Long Term

  • AI-Generated Agents - Automatic agent creation
  • Blockchain Integration - Decentralized agent rewards
  • Real-time Collaboration - Multi-user conversion workflows
  • Format Prediction - ML-powered format suggestions

๐Ÿ† Acknowledgments

Special thanks to:

  • OpenAgents Team - For the amazing framework
  • Contributors - Everyone who helps improve OpenConvert
  • Community - Users who provide feedback and ideas
  • Dependencies - All the great open source libraries we use

Built With


๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


โญ Star this repo if you found it helpful!

Made with โค๏ธ by the OpenAgents community

Transforming files, one conversion at a time ๐Ÿ”„

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openconvert-1.0.0.tar.gz (126.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openconvert-1.0.0-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file openconvert-1.0.0.tar.gz.

File metadata

  • Download URL: openconvert-1.0.0.tar.gz
  • Upload date:
  • Size: 126.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for openconvert-1.0.0.tar.gz
Algorithm Hash digest
SHA256 056970cbda22abbd36d29fb62f504d3137edcbf6f799b9bed88dc4884449e75d
MD5 48a64c9087b3473ae7d06195f8b84a29
BLAKE2b-256 7897f7e7d96880c49cf252974cdc68cfb9690db45c5ecb61731c3fead367cfd5

See more details on using hashes here.

File details

Details for the file openconvert-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: openconvert-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for openconvert-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 958fe0cda4b500a366678bfa95afbf37e6374b93f6e372176378c6eb3257af96
MD5 8008e7ea4eab7ab910372ac7cff875e1
BLAKE2b-256 fdd709939fbfaa6f23e5c054b132917cb648b9259a2aa0788c81ca4c4d87ab7b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page