Convertio APIs Client Library for Python
Project description
Convertio APIs Client Library for Python
Inspired by the original PHP Package but Pythonic.
This is a lightweight wrapper for the Convertio API.
Feel free to use, improve or modify this wrapper! If you have questions contact us or open an issue on GitHub.
Requirements
Developer Documentation
You can find full API reference here: https://convertio.co/api/docs/
Quickstart
Initialize convertio
client:
import os
from convertio import client
convertio = client.ConvertIO(api_key=os.environ.get('CONVERTIO_API_KEY'))
Following example will convert PNG file to PDF:
from convertio.models import parameters
# Example of converting a file
payload = parameters.NewConversionParameters(
file="https://files.jotform.com/jotformapps/proforma-invoice-template-18a679482c789d2acf0db2d6f9324d94_og.png",
outputformat="PDF"
)
response = convertio.new_conversion(payload=payload)
OCR Quickstart
Following example will convert pages 1-3,5,7 of PDF into editable DOCX, using OCR (Optical Character Recognition) for English and Arabic languages (Full list of available languages):
from convertio.models import parameters
from convertio.languages import Languages
# OCR Example
OCR_SETTINGS = parameters.OCRParameters.OCRSettings(langs=[Languages.ARABIC.value, Languages.ENGLISH.value])
payload = parameters.NewConversionParameters(
file="https://files.jotform.com/jotformapps/proforma-invoice-template-18a679482c789d2acf0db2d6f9324d94_og.png",
outputformat="txt",
options=parameters.OCRParameters(ocr_enabled=True, ocr_settings=OCR_SETTINGS)
)
response = convertio.new_conversion(payload=payload)
Installation
You can use poetry or simply pip
pip
pip install convertio-python
Poetry
poetry add convertio-python
Resources
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
convertio_python-0.1.2.tar.gz
(8.8 kB
view hashes)
Built Distribution
Close
Hashes for convertio_python-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 882b9d691a2527bc1d9e721861bec21bc3262b039d67ee4309d9ee4b9666acaa |
|
MD5 | 85824e4034365706fca4a44fe0b9e8c2 |
|
BLAKE2b-256 | 9621af64ea74d4560927aaa7d6101b4973ea55712cbdd4a08317f9ad1121170c |