Giter Club home page Giter Club logo

cloudconvert-python's Introduction

cloudconvert-python

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.jpg', '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

cloudconvert-python's People

Contributors

atlas48 avatar josiasmontag avatar renatgalimov avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.