Skip to main content
Help us improve Python packaging – donate today!

A file conversion Web API in Pyramid

Project Description

Convertit is a format conversion webservice.

Retrieve your document in an other format ! The input file is converted and served back ! Using a dead simple GET request, documents are pulled. Using POST request, it takes the attachment.

Supported conversions:

  • odt -> pdf
  • odt -> doc
  • ods -> xls
  • csv -> ods
  • csv -> xls
  • svg -> pdf
  • svg -> png

Previously converted documents are cleaned along the way (on each request).


Using GET request

Example, convert from odt to pdf :

curl http://convertit/?url=http://server/document.odt&to=application/pdf
HTTP/1.1 302 Found
Content-Disposition: attachement; filename=document.pdf

GET parameters:

url: absolute url of the document to be converted.

“url” also supports a “{X_FORWARDED_FOR}” placeholder for requests not knowing their own host. “{X_FORWARDED_FOR}” will be replaced with the corresponding “X_FORWARDED_FOR” header if available. Be warned that “X_FORWARDED_FOR” is not a safe value since it can be modified by user agents or given false value by forward proxies. Use only if really needed. Exemple:

curl "http://convertit/?url=http://{X_FORWARDED_FOR}/document.odt&to=application/pdf"

Using POST request

Upload data in POST parameter named file:

curl -F "file=@tiger.svg" http://convertit/?to=image/png
HTTP/1.1 302 Found
Content-Disposition: attachement; filename=tiger.png

Query parameters

  • to: output mimetype (optionnal, default to application/pdf if not provided);
  • from: input mimetype (optionnal, guessed from input url or file if not provided).


System dependencies

  • for OpenDocument support: unoconv
  • for SVG support: inkscape

Conversion binaries should be in system PATH (which is used internally.)


  • Download and extract a released tarball from pypi

  • The bleeding edge version is hosted on github

    git clone
    cd convertit


make serve

Once the application is running, you may visit http://localhost:6543/ in your browser.

Run tests:

make tests


Using gunicorn for example :

gunicorn_paster --workers=4 production.ini

Using Docker :

sudo docker build -t="convertit" .
sudo docker run -p :6543 convertit


Open an issue to report a bug or request a new feature.



  • Antoine Cezar
  • Alex Marandon



1.1.0 (2014-05-21)

  • Use original request header Accept-language to download the URL

  • Add {X_FORWARDED_FOR} placeholder in GET url parameter. Replaced by the corresponding header if available. It avoids the client initiating the request to be aware of its own address. Exemple:

    curl "http://convertit/?url=http://{X_FORWARDED_FOR}/document.odt&to=application/pdf"

1.0 (2013-09-03)

  • Initial working version

Release history Release notifications

History Node


History Node


History Node


History Node


History Node


This version
History Node


History Node


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date (79.7 kB) Copy SHA256 hash SHA256 Source None May 21, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page