Skip to content

gitstq/UniConvert-CLI

Repository files navigation

🔄 UniConvert-CLI

Universal File Format Converter
A powerful command-line tool for converting files between various formats

English简体中文繁體中文

Python 3.8+ License: MIT Platform


🇺🇸 English

🎉 Introduction

UniConvert-CLI is a universal file format converter designed for developers, content creators, and power users who need to convert files quickly and efficiently from the command line.

Why UniConvert-CLI?

  • 🚀 All-in-One Solution: Convert documents, images, audio, video, archives, and data formats
  • Lightning Fast: Multi-threaded batch processing for maximum efficiency
  • 🎯 Easy to Use: Simple commands with intelligent defaults
  • 🔧 Extensible: Plugin architecture for custom converters
  • 💪 Reliable: Comprehensive error handling and validation

✨ Features

📄 Document Conversion

  • Supported Formats: PDF, DOCX, TXT, MD, HTML, EPUB, RTF, ODT
  • Convert between office documents and markup formats
  • Preserve formatting during conversion

🖼️ Image Conversion

  • Supported Formats: PNG, JPG, GIF, BMP, WebP, TIFF, SVG, ICO
  • Quality control and optimization
  • Batch resize and format conversion

🎵 Audio Conversion

  • Supported Formats: MP3, WAV, FLAC, AAC, OGG, M4A, WMA
  • Bitrate and quality adjustment
  • Metadata preservation

🎬 Video Conversion

  • Supported Formats: MP4, AVI, MKV, MOV, WMV, FLV, WebM
  • Resolution and frame rate control
  • Hardware acceleration support (via ffmpeg)

📦 Archive Conversion

  • Supported Formats: ZIP, TAR, GZIP, BZIP2, XZ, 7Z, RAR
  • Extract and repackage archives
  • Cross-format archive conversion

📊 Data/Code Conversion

  • Supported Formats: JSON, YAML, XML, CSV, TOML, INI
  • Structured data transformation
  • Format validation

🚀 Quick Start

Installation

# Install from PyPI
pip install uniconvert-cli

# Or install with development dependencies
pip install uniconvert-cli[dev]

Basic Usage

# Convert a single file
uniconvert input.jpg output.png

# Convert to specific format
uniconvert document.docx -f pdf

# Batch convert
uniconvert *.jpg -o output_dir/ -f png

# Convert with quality options
uniconvert video.mp4 output.webm --quality 80 --fps 30

Command Reference

# List all supported formats
uniconvert --list-formats

# Check available dependencies
uniconvert --check-deps

# Show help
uniconvert --help

📖 Detailed Usage Guide

Single File Conversion

# Convert image format
uniconvert photo.png photo.jpg

# Convert with specific quality
uniconvert image.png -f jpg -q 90

# Convert document
uniconvert report.docx -f pdf

Batch Conversion

# Convert all images in a directory
uniconvert *.png -o converted/ -f jpg

# Convert with parallel processing
uniconvert *.mp4 -o output/ -f webm -j 8

Advanced Options

# Video conversion with custom settings
uniconvert input.mp4 output.mp4 --resolution 1920x1080 --fps 30 --bitrate 2M

# Audio conversion with quality setting
uniconvert input.wav output.mp3 --bitrate 320k

# Dry run (show what would be done)
uniconvert *.png -f jpg --dry-run

💡 Design Philosophy

UniConvert-CLI was designed with the following principles:

  1. Simplicity: Common tasks should be simple, complex tasks possible
  2. Performance: Leverage multi-threading for batch operations
  3. Reliability: Comprehensive error handling and validation
  4. Extensibility: Easy to add new format support
  5. Integration: Works well in scripts and CI/CD pipelines

📦 Building from Source

# Clone the repository
git clone https://github.com/yourusername/uniconvert-cli.git
cd uniconvert-cli

# Install in development mode
pip install -e ".[dev]"

# Run tests
make test

# Build package
make build

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

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


🇨🇳 简体中文

🎉 项目介绍

UniConvert-CLI 是一款通用文件格式转换器,专为开发者、内容创作者和高级用户设计,可以从命令行快速高效地转换文件。

为什么选择 UniConvert-CLI?

  • 🚀 一体化解决方案:转换文档、图片、音频、视频、压缩包和数据格式
  • 极速转换:多线程批处理,效率最大化
  • 🎯 简单易用:简洁命令,智能默认设置
  • 🔧 可扩展:插件架构支持自定义转换器
  • 💪 稳定可靠:全面的错误处理和验证

✨ 核心特性

📄 文档转换

  • 支持格式:PDF、DOCX、TXT、MD、HTML、EPUB、RTF、ODT
  • 在办公文档和标记格式之间转换
  • 转换过程中保留格式

🖼️ 图片转换

  • 支持格式:PNG、JPG、GIF、BMP、WebP、TIFF、SVG、ICO
  • 质量控制和优化
  • 批量调整大小和格式转换

🎵 音频转换

  • 支持格式:MP3、WAV、FLAC、AAC、OGG、M4A、WMA
  • 比特率和质量调整
  • 保留元数据

🎬 视频转换

  • 支持格式:MP4、AVI、MKV、MOV、WMV、FLV、WebM
  • 分辨率和帧率控制
  • 硬件加速支持(通过 ffmpeg)

📦 压缩包转换

  • 支持格式:ZIP、TAR、GZIP、BZIP2、XZ、7Z、RAR
  • 解压和重新打包压缩包
  • 跨格式压缩包转换

📊 数据/代码转换

  • 支持格式:JSON、YAML、XML、CSV、TOML、INI
  • 结构化数据转换
  • 格式验证

🚀 快速开始

安装

# 从 PyPI 安装
pip install uniconvert-cli

# 或者安装开发依赖版本
pip install uniconvert-cli[dev]

基本用法

# 转换单个文件
uniconvert input.jpg output.png

# 转换为特定格式
uniconvert document.docx -f pdf

# 批量转换
uniconvert *.jpg -o output_dir/ -f png

# 带质量选项的转换
uniconvert video.mp4 output.webm --quality 80 --fps 30

命令参考

# 列出所有支持的格式
uniconvert --list-formats

# 检查可用依赖
uniconvert --check-deps

# 显示帮助
uniconvert --help

📖 详细使用指南

单文件转换

# 转换图片格式
uniconvert photo.png photo.jpg

# 带特定质量的转换
uniconvert image.png -f jpg -q 90

# 转换文档
uniconvert report.docx -f pdf

批量转换

# 转换目录中的所有图片
uniconvert *.png -o converted/ -f jpg

# 并行处理转换
uniconvert *.mp4 -o output/ -f webm -j 8

高级选项

# 带自定义设置的视频转换
uniconvert input.mp4 output.mp4 --resolution 1920x1080 --fps 30 --bitrate 2M

# 带质量设置的音频转换
uniconvert input.wav output.mp3 --bitrate 320k

# 试运行(显示将要执行的操作)
uniconvert *.png -f jpg --dry-run

💡 设计理念

UniConvert-CLI 遵循以下设计原则:

  1. 简洁性:常见任务简单,复杂任务可行
  2. 性能:利用多线程进行批量操作
  3. 可靠性:全面的错误处理和验证
  4. 可扩展性:易于添加新格式支持
  5. 集成性:与脚本和 CI/CD 管道良好配合

📦 从源码构建

# 克隆仓库
git clone https://github.com/yourusername/uniconvert-cli.git
cd uniconvert-cli

# 以开发模式安装
pip install -e ".[dev]"

# 运行测试
make test

# 构建包
make build

🤝 贡献指南

我们欢迎贡献!详情请参阅我们的贡献指南

  1. Fork 仓库
  2. 创建功能分支 (git checkout -b feature/amazing-feature)
  3. 提交更改 (git commit -m 'feat: add amazing feature')
  4. 推送到分支 (git push origin feature/amazing-feature)
  5. 打开 Pull Request

📄 开源协议

本项目采用 MIT 协议 - 详情请参阅 LICENSE 文件。


🇹

About

🔄 Universal File Format Converter - A powerful CLI tool for converting files between various formats

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors