Skip to main content

Official CloudConvert API wrapper

Project description

This is a lightweight wrapper for the CloudConvert API.

Feel free to use, improve or modify this wrapper! If you have questions contact us or open an issue on GitHub.

PyPi Version Build Status

Quickstart

import cloudconvert

api = cloudconvert.Api('your_api_key')

process = api.convert({
    'inputformat': 'png',
    'outputformat': 'jpg',
    'input': 'upload',
    'file': open('tests/input.png', 'rb')
})
process.wait() # wait until conversion finished
process.download("tests/output.png") # download output file

You can use the CloudConvert API Console to generate ready-to-use python code snippets using this wrapper.

Installation

The easiest way to get the latest stable release is to grab it from pypi using pip.

pip install cloudconvert

Download of multiple output files

In some cases it might be possible that there are multiple output files (e.g. converting a multi-page PDF to JPG). You can download them all to one directory using the downloadAll() method.

import cloudconvert

api = cloudconvert.Api('your_api_key')

process = api.convert({
    'inputformat': 'pdf',
    'outputformat': 'jpg',
    'converteroptions': {
        'page_range': '1-3'
    },
    'input': 'upload',
    'file': open('tests/input.pdf', 'rb')
process.wait()
process.downloadAll("tests")
})

Alternatively you can iterate over process['output']['files'] and download them seperately using process.download(localfile, remotefile).

How to run tests?

pip install -r requirements-dev.txt
export API_KEY=your_api_key
nosetests

Resources

Project details


Download files

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

Source Distribution

cloudconvert-1.0.0.tar.gz (5.9 kB view details)

Uploaded Source

File details

Details for the file cloudconvert-1.0.0.tar.gz.

File metadata

  • Download URL: cloudconvert-1.0.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cloudconvert-1.0.0.tar.gz
Algorithm Hash digest
SHA256 bffd9ed57458a143bafad0aac8e8019961cc326b18f962eab1432fb47bb4a036
MD5 0f807308e6d6c639847ec947e2481dcb
BLAKE2b-256 ec01788eb7a3ad516155b8b204d5ab24b2cadd8bc7addc73b2de997c034ca660

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page