Skip to main content

Universal file converter using pure Python libraries

Project description

any2any – Universal File Converter

Convert any file to any other file using pure Python libraries. No external binaries required (except optional ones for some formats). Uses a graph of 386 formats to find a conversion path via BFS.

Features

  • PDF to video slideshow – renders each page to an image, then creates a video.
  • Image to video – loop a single image for a few seconds.
  • Document conversion – uses pandoc (via pypandoc) for markdown, docx, etc.
  • Text to speech – uses pyttsx3 (native OS) or espeak‑ng.
  • Many image formats – via Pillow.
  • Specialized formats (optional) – MIDI, Minecraft NBT, BSON, JSON5, and more.

Installation

pip install any2any

For optional game formats:

pip install any2any[game]

Requirements

  • Python 3.8 or later
  • No system‑wide dependencies needed for basic operation – the package bundles or automatically downloads all required libraries (e.g., pypandoc will download pandoc on first use).

Usage

any2any input.pdf output.mp4

First run will build the conversion graph from the included cache.json. Subsequent runs load it instantly.

How it works

  1. The graph (derived from the original convert.to.it project) defines which formats can be directly converted by which tools.
  2. BFS finds the shortest path from input format to output format.
  3. Each step uses a pure Python library (or subprocess fallback) to perform the conversion, possibly creating intermediate files in a temporary directory.

Examples

  • Convert a multi‑page PDF to a slideshow video (1 second per page):
any2any document.pdf slideshow.mp4
  • Convert a single JPEG to a 5‑second MP4 loop:
any2any photo.jpg video.mp4
  • Convert a Markdown file to DOCX:
any2any readme.md report.docx

Limitations

  • Some conversions (e.g., complex video filters) may not be supported by the pure Python libraries.
  • The package relies on pypandoc to handle document conversions; it may take a few seconds to download pandoc on first use.
  • For text‑to‑speech, the script attempts to use espeak-ng via subprocess; if not found, it falls back to pyttsx3 (which uses native OS speech).

License

GPL‑2.0‑or‑later (to match the original project). See LICENSE.

Acknowledgements

Based on the format graph from convert.to.it and the original TypeScript handlers.

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

any2any-0.0.1.dev1.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

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

any2any-0.0.1.dev1-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file any2any-0.0.1.dev1.tar.gz.

File metadata

  • Download URL: any2any-0.0.1.dev1.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for any2any-0.0.1.dev1.tar.gz
Algorithm Hash digest
SHA256 9c26bc30c1a2f97bf7a455836a678461bb62c2943380d9b4688a2f302a5350c8
MD5 bf7f3e066e4542a39d5cd474a307334c
BLAKE2b-256 c45b6c788bd42ef1c5f28fbef827838268acfb71ae9c84a3b41f9ee6af99304a

See more details on using hashes here.

File details

Details for the file any2any-0.0.1.dev1-py3-none-any.whl.

File metadata

  • Download URL: any2any-0.0.1.dev1-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for any2any-0.0.1.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 cd5e834b780be0f85074ab6e1a9d9c9f8323ec3755efa4cd55eca145661398d4
MD5 78f0cccb9e81f32c64ed32a9265acbd1
BLAKE2b-256 da17a3f1f570b7ecf8267ff59e8e15b7662b06c314f60676a192b2240323d8be

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