Conversion Tools API Python Client
Project description
Conversion Tools API Python Client
Conversion Tools is an online service that offers a fast and easy way to convert documents between different formats, like XML, Excel, PDF, Word, Text, CSV and others.
This Client allows to integrate the conversion of the files into Python applications.
To convert the files Python Client uses the public Conversion Tools REST API.
Installation
pip install --upgrade conversiontools
or when building from the sources:
python setup.py install
Examples
To use REST API - get API Token from the Profile page at https://conversiontools.io/profile.
See example test.py
in the ./examples/
folder.
from conversiontools import ConversionClient
# put token here from your Profile page at https://conversiontools.io/profile
token = ''
# files
fileInput = 'test.xml'
fileOutput = 'test.csv'
client = ConversionClient(token)
try:
client.convert('convert.xml_to_csv', fileInput, fileOutput, { 'delimiter': 'tabulation' })
except Exception as error:
print(error)
API
Create ConversionClient
instance with a token.
from conversiontools import ConversionClient
client = ConversionClient('<token>')
Where <token>
is API token from the account's Profile page https://conversiontools.io/profile.
Convert input file and download the result
try:
client.convert('<conversion type>', fileInput, fileOutput, '<options>')
except Exception as error:
print(error)
Where
<conversion type>
is a specific type of conversion, from API Documentation.<options>
is a Python dict with options for a corresponding converter, for example:
options = { 'delimiter': 'tabulation' }
Documentation
List of available Conversion Types and corresponding conversion options can be found on the Conversion Tools API Documentation page.
License
Licensed under MIT.
Copyright (c) 2020 Conversion Tools
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
Built Distribution
File details
Details for the file conversiontools-1.0.0.tar.gz
.
File metadata
- Download URL: conversiontools-1.0.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d25604ead9ca0e3ec747f779a9286f019f00b024d76129337c19f40b9d171e36 |
|
MD5 | af6080d1eda7e557af292c45f81d452f |
|
BLAKE2b-256 | e7c4e081801d7ca1612242e8ed75449222ab645404ddd0dd6543fb054cba273d |
File details
Details for the file conversiontools-1.0.0-py2.py3-none-any.whl
.
File metadata
- Download URL: conversiontools-1.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 578b6b981c26136b8e68dfafd813b42d9fa7094364f4c9d4ce0a6b052db2bafe |
|
MD5 | 7eea5871165f68fa662e0060d25b59c9 |
|
BLAKE2b-256 | 6827723d2f70fa658b3fdf88dc99e9b7ccd75435cebea8ab879702a34e6c02cb |