πŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more β†’
Socket
DemoInstallSign in
Socket

convert-offline

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

convert-offline

Convert Anything Offline β€” a modular CLI tool for file format conversion.

0.1.2
PyPI
Maintainers
1

CAO β€” Convert Anything Offline

CAO is a modular, offline-first command-line tool that lets you convert files between dozens (eventually hundreds) of formats β€” images, text, geospatial, and more. Designed to be clean, extensible, and completely offline, CAO also includes plugin support for community-driven converters.

Features

  • Convert files across many format families (image, text, geospatial, etc.)
  • Auto-discovery of sources and targets
  • Plugin system with install/remove/reload support
  • Built-in support for common geospatial formats (GeoJSON, Shapefile, GeoParquet, CSV with lat/lon)
  • Architecture designed for scale β€” clean interfaces and grouping
  • Easy to test and extend
  • Fully offline β€” no internet required to use

Installation

CAO is currently distributed via GitHub.

git clone https://github.com/jackmcnulty/cao.git
cd cao
pip install -e .

You’ll need:

  • Python 3.8+
  • pip
  • Basic packages: click, Pillow, geopandas, pandas, shapely, fiona, pyarrow (check setup.py for full list)

Usage

Convert files

cao convert input.png output.jpg
cao convert input.txt output.png
cao convert data.geojson output.csv

CAO will determine what type of content you're converting and route it to the right source and target.

See what a format can convert to

cao from png
cao from geojson
cao from csv

Outputs something like:

You can convert 'geojson' into:
- csv
- shp
- parquet

Plugin System

CAO supports installable converters and features via plugins.

List installed plugins

cao plugin list

Install a plugin

cao plugin install ./my_plugin.py
cao plugin install ./plugin_bundle.zip

Remove a plugin

cao plugin remove my_plugin

Reload all plugins (dev-time hotload)

cao plugin reload

Bundle all installed plugins into a ZIP

cao plugin bundle my_plugins.zip

Creating Your Own Converter

Create a Source

from cao.sources.base import BaseSource
from cao.registry import ConverterRegistry

class HelloSource(BaseSource):
    def extract(self, path):
        return {"type": "text", "data": "Hello from source"}

    @classmethod
    def supported_extensions(cls):
        return ["hello"]

    @classmethod
    def data_type(cls):
        return "text"

ConverterRegistry.register_source("hello", HelloSource)

Create a Target

from cao.targets.base import BaseTarget
from cao.registry import ConverterRegistry

class UpperTextTarget(BaseTarget):
    def write(self, data, path):
        with open(path, "w") as f:
            f.write(data["data"].upper())

    @staticmethod
    def accepts_type(data_type):
        return data_type == "text"

ConverterRegistry.register_target("txt", lambda ext: UpperTextTarget())

πŸ“ Project Structure

cao/
β”œβ”€β”€ cao/
β”‚   β”œβ”€β”€ cli.py
β”‚   β”œβ”€β”€ engine.py
β”‚   β”œβ”€β”€ registry.py
β”‚   β”œβ”€β”€ sources/
β”‚   β”‚   β”œβ”€β”€ image/
β”‚   β”‚   β”œβ”€β”€ geospatial/
β”‚   β”œβ”€β”€ targets/
β”‚   β”‚   β”œβ”€β”€ text/
β”‚   β”‚   β”œβ”€β”€ image/
β”‚   β”‚   β”œβ”€β”€ geospatial/
β”‚   β”œβ”€β”€ plugins/
β”œβ”€β”€ README.md
β”œβ”€β”€ setup.py
β”œβ”€β”€ pyproject.toml

Contributing

Want to contribute?

  • See CONTRIBUTING.md for how to add new converters
  • Keep things modular β€” one class per source/target, grouped by format type
  • Follow naming conventions and interface expectations
  • PRs are welcome!

License

MIT License β€” free to use, modify, and share.

Roadmap

  • Lots of new converters

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts