You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
A Python module for the[Zencoder](http://zencoder.com) API.
7
+
A Python module for interacting with the[Zencoder](http://zencoder.com) API.
8
+
9
+
###Getting Started
10
+
11
+
Install from PyPI
12
+
13
+
$ pip install zencoder
14
+
15
+
Import zencoder
16
+
17
+
```python
18
+
from zencoderimport Zencoder
19
+
```
20
+
21
+
Create an instance of the Zencoder client. This will accept an API key and version. If not API key is set, it will look for a`ZENCODER_API_KEY` environment variable. API version defaults to 'v2'.
22
+
23
+
# If you want to specify an API key when creating a client
By default the jobs listing is paginated with 50 jobs per page and sorted by ID in descending order. You can pass two parameters to control the paging:`page` and`per_page`.
51
+
52
+
```python
53
+
client.job.list(per_page=10)
54
+
client.job.list(per_page=10,page=2)
55
+
```
56
+
57
+
Get[details](https://app.zencoder.com/docs/api/jobs/show) about a job.
58
+
59
+
The number passed to`details` is the ID of a Zencoder job.
60
+
61
+
```python
62
+
client.job.details(1)
63
+
```
64
+
65
+
Get[progress](https://app.zencoder.com/docs/api/jobs/progress) on a job.
66
+
67
+
The number passed to`progress` is the ID of a Zencoder job.
68
+
69
+
```python
70
+
client.job.progress(1)
71
+
```
72
+
73
+
[Resubmit](https://app.zencoder.com/docs/api/jobs/resubmit) a job
74
+
75
+
The number passed to`resubmit` is the ID of a Zencoder job.
76
+
77
+
```python
78
+
client.job.resubmit(1)
79
+
```
80
+
81
+
[Cancel](https://app.zencoder.com/docs/api/jobs/cancel) a job
82
+
83
+
The number passed to`cancel` is the ID of a Zencoder job.
**Note:** If you set the`ZENCODER_API_KEY` environment variabletoyour api key, you don't have to provide it when initializing Zencoder.
126
+
Reports are great for getting usage data for your account. All defaultto30 days from yesterday with no[grouping](https://app.zencoder.com/docs/api/encoding/job/grouping), but this can be altered. These will return`422 Unprocessable Entity` if the date format is incorrect or the range is greater than 2 months.
47
127
48
-
##Specifying the API Version
49
-
Set the version of the Zencoder API you want to use as the`api_version` keyword to the`Zencoder` object (defaults to`v2`):
Create a[new account](https://app.zencoder.com/docs/api/accounts/create). A unique email address and terms of service are required, but you can also specify a password (and confirmation) along with whether or not you want to subscribe to the Zencoder newsletter. New accounts will be created under the Test (Free) plan.
170
+
171
+
No API Key is required.
172
+
173
+
```python
174
+
client.account.create('foo@example.com',tos=1)
175
+
client.account.create('foo@example.com',tos=1,
176
+
options={'password':'abcd1234',
177
+
'affiliate_code':'foo'})
178
+
```
179
+
180
+
Get[details](https://app.zencoder.com/docs/api/accounts/show) about the current account.
181
+
182
+
```python
183
+
client.account.details()
184
+
```
185
+
186
+
Turn[integration mode](https://app.zencoder.com/docs/api/accounts/integration) on (all jobs are test jobs).
187
+
188
+
```python
189
+
client.account.integration()
190
+
```
191
+
192
+
Turn off integration mode, which means your account is live (and you'll be billed for jobs).
193
+
194
+
```python
195
+
client.account.live()
57
196
```
58
197
59
198
##Additional settings
@@ -62,12 +201,13 @@ In adition Zencoder class consructor takes these arguments:
62
201
*`cert` - (optional) if String, path to ssl client cert file (.pem). If Tuple, (‘cert’, ‘key’) pair.
63
202
*`http_timeout` - (optional) Float describing the timeout of the request
64
203
65
-
##Documentation
66
-
Docs are in progress, and hosted at Read the Docs:http://zencoder.rtfd.org
204
+
##Tests
205
+
206
+
The tests use the`mock` library to stub in response data from the API. Run tests individually: