Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

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.

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
Release History

Release History

This version
History Node

1.0.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
cloudconvert-1.0.0.tar.gz (5.9 kB) Copy SHA256 Checksum SHA256 Source Nov 27, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting