Package: convertit
Convertitis a format conversion webservice.Retrieve your document in an other format ! The input file is converted and served back !
Using a dead simpleGETrequest, documents are pulled. UsingPOSTrequest, it takes the attachment.Supported conversions:odt -> pdfodt -> docods -> xlscsv -> odscsv -> xlssvg -> pdfsvg -> pngPreviously converted documents are cleaned along the way (on each request).USAGEUsing GET requestExample, convert fromodttopdf: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 requestUpload data in POST parameter namedfile:curl -F "file=@tiger.svg" http://convertit/?to=image/png
HTTP/1.1 302 Found
Content-Disposition: attachement; filename=tiger.pngQuery parametersto: output mimetype (optionnal, default toapplication/pdfif not provided);from: input mimetype (optionnal, guessed from input url or file if not provided).INSTALLSystem dependenciesforOpenDocumentsupport:unoconvforSVGsupport:inkscapeConversion binaries should be in systemPATH(whichis used internally.)DownloadDownload and extract a released tarball frompypiThe bleeding edge version is hosted ongithubgit clone https://github.com/makinacorpus/convertit.git
cd convertitDevelopmentmake serveOnce the application is running, you may visithttp://localhost:6543/in your browser.Run tests:make testsProductionUsinggunicornfor example :gunicorn --workers=1 --paste=production.iniUsing Docker :sudo docker build -t="convertit" .
sudo docker run -p :6543 convertitFeedbackOpenan issueto report a
bug or request a new feature.CREDITSCompaniesPlanet Makina CorpusContact usAuthorsAntoine CezarAlex MarandonContributorskiorky  <kiorky@cryptelium.net>Mathieu Leplatre <mathieu.leplatre@makina-corpus.com>Gaël Utard <gael.utard@makina-corpus.com>Jean-Etienne Castagnede <j.e.castagnede@gmail.com>CHANGELOG2.0.0 (2019-11-22)Move from Python 2 to Python 31.1.5 (2015-04-01)Fix systematic crash in unoconv converter1.1.4 (2015-04-01)Serialize parallel libreoffice conversions with flock instead of celery1.1.3 (2015-01-20)Serialize parallel libreoffice conversions1.1.2 (2014-12-30)Fix a crash in unoconv error handlingLog errorsAdd a warning about unoconv not able to work in parallel1.1.1 (2014-12-18)Send HTTP errors as raw strings instead of HTML documents1.1.0 (2014-05-21)Use original request headerAccept-languageto download the URLAdd {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