44A Python module for the [ Zencoder] ( http://zencoder.com ) API.
55
66## Installation
7- Install from PyPI using ` easy_install ` or ` pip ` .
7+ Install from PyPI using ` pip ` .
88
99 pip install zencoder
1010
@@ -13,19 +13,26 @@ Install from PyPI using `easy_install` or `pip`.
1313
1414## Usage
1515
16+ ### Create an instance of ` Zencoder `
17+
1618 from zencoder import Zencoder
1719 zen = Zencoder('abc123') # enter your api key
1820
21+ ### Submit a job
22+
1923 # creates an encoding job with the defaults
2024 job = zen.job.create('http://input-file/movie.avi')
2125 print job.code
2226 print job.body
2327 print job.body['id']
2428
29+ ### Return output progress
30+
2531 # get the transcode progress of the first output
2632 progress = zen.output.progress(job.body['outputs'][0]['id'])
2733 print progress.body
2834
35+ ### Create a new job with multiple outputs
2936
3037 # configure your outputs with dictionaries
3138 iphone = {
@@ -39,11 +46,20 @@ Install from PyPI using `easy_install` or `pip`.
3946 'url': 's3://output-bucket/output-file.vp8',
4047 'video_codec':, 'vp8'
4148 }
49+
4250 # the outputs kwarg requires an iterable
4351 outputs = (iphone, web)
4452 another_job = zen.job.create(input_url, outputs=outputs)
4553
46- ** Note:** If you set the ` ZENCODER_API_KEY ` environment variable to your api key, you don't have to provide it when initializing Zencoder.
54+ ### ZENCODER_API_KEY Environment Variable
55+
56+ ``` python
57+ import os
58+ os.environ[' ZENCODER_API_KEY' ] = ' abcd1234'
59+ zen = Zencoder()
60+ ```
61+
62+ If you set ` ZENCODER_API_KEY ` to your API Key, you don't have to provide it when initializing Zencoder.
4763
4864## Specifying the API Version
4965Set the version of the Zencoder API you want to use as the ` api_version ` keyword to the ` Zencoder ` object (defaults to ` v2 ` ):
0 commit comments