From f91a402b2e0c372b6e7466858129bf9ee4d376ba Mon Sep 17 00:00:00 2001 From: Alex Schworer Date: Wed, 5 Jun 2013 16:32:17 -0700 Subject: [PATCH 1/6] Update readme docs with usage --- README.md | 204 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 204 insertions(+) diff --git a/README.md b/README.md index 082bda0..9322a1c 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,210 @@ zen = Zencoder(api_version='v1') # set to the edge version: https://app.zencoder.com/api/ zen = Zencoder(api_version='edge') ``` + +## Jobs + +There's more you can do on jobs than anything else in the API. The following methods are available: `list`, `create`, `details`, `progress`, `resubmit`, `cancel`, `delete`. + +### create + +```python +zen.job.create('s3://bucket/key.mp4') +zen.job.create('s3://bucket/key.mp4', + outputs=[{'label': 'vp8 for the web', + 'url': 's3://bucket/key_output.webm'}]) +``` + +This returns a `zencoder.Response` object. The body includes a Job ID, and one or more Output IDs (one for every output file created). + +```python +response = zen.job.create('s3://bucket/key.mp4') +response.code # 201 +response.body['id'] # 12345 +``` + +### list + +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`. + +```python +zen.job.list(per_page=10) +zen.job.list(per_page=10, page=2) +``` + +### details + +The number passed to `details` is the ID of a Zencoder job. + +```python +zen.job.details(1) +``` + +### progress + +The number passed to `progress` is the ID of a Zencoder job. + +```python +zen.job.progress(1) +``` + +### resubmit + +The number passed to `resubmit` is the ID of a Zencoder job. + +```python +zen.job.resubmit(1) +``` + +### cancel + +The number passed to `cancel` is the ID of a Zencoder job. + +```python +zen.job.cancel(1) +``` + +### delete + +The number passed to `delete` is the ID of a Zencoder job. + +```python +zen.job.delete(1) +``` + +## Inputs + +### details + +The number passed to `details` is the ID of a Zencoder job. + +```python +zen.input.details(1) +``` + +### progress + +The number passed to `progress` is the ID of a Zencoder job. + +```python +zen.input.progress(1) +``` + +## Outputs + +### details + +The number passed to `details` is the ID of a Zencoder job. + +```python +zen.output.details(1) +``` + +### progress + +The number passed to `progress` is the ID of a Zencoder job. + +```python +zen.output.progress(1) +``` + +## Accounts + +### create + +No API Key is required. + +```python +zen.account.create('foo@example.com', tos=1) +zen.account.create('foo@example.com', tos=1, + options={'password': 'abcd1234', + 'affiliate_code': 'foo'}) +``` + +### details + +```python +zen.account.details() +``` + +### integration + +This will put your account into integration mode (site-wide). + +```python +zen.account.integration() +``` + +### live + +This will put your account into live mode (site-wide). + +```python +zen.account.live() +``` + +## Reports + +### minutes + +This will list the minutes used for your account within a certain, configurable range. + +```python +import datetime +zen.report.minutes() +zen.report.minutes(grouping="foo") +zen.report.minutes(start_date=datetime.date(2011, 10, 30), + end_date=datetime.date(2011, 11, 24)) +zen.report.minutes(start_date=datetime.date(2011, 10, 30), + end_date=datetime.date(2011, 11, 24), + grouping="foo") +``` + +### vod + +This will list the VOD minutes used for your account. + +```python +import datetime +zen.report.vod() +zen.report.vod(grouping="foo") +zen.report.vod(start_date=datetime.date(2011, 10, 30), + end_date=datetime.date(2011, 11, 24)) +zen.report.vod(start_date=datetime.date(2011, 10, 30), + end_date=datetime.date(2011, 11, 24), + grouping="foo") +``` + +### live + +This will list the Live transcoding minutes used for your account. + +```python +import datetime +zen.report.live() +zen.report.live(grouping="foo") +zen.report.live(start_date=datetime.date(2011, 10, 30), + end_date=datetime.date(2011, 11, 24)) +zen.report.live(start_date=datetime.date(2011, 10, 30), + end_date=datetime.date(2011, 11, 24), + grouping="foo") +``` + +### all + +This will list all of the transcoding minutes used for your account. + +```python +import datetime +zen.report.all() +zen.report.all(grouping="foo") +zen.report.all(start_date=datetime.date(2011, 10, 30), + end_date=datetime.date(2011, 11, 24)) +zen.report.all(start_date=datetime.date(2011, 10, 30), + end_date=datetime.date(2011, 11, 24), + grouping="foo") +``` + ## Documentation Docs are in progress, and hosted at Read the Docs: http://zencoder.rtfd.org From a1728bd03ce089174715cf2e83ea6ead7e13a405 Mon Sep 17 00:00:00 2001 From: Alex Schworer Date: Wed, 5 Jun 2013 17:58:29 -0600 Subject: [PATCH 2/6] Update README.md --- README.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9322a1c..1d8406d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ A Python module for the [Zencoder](http://zencoder.com) API. ## Installation -Install from PyPI using `easy_install` or `pip`. +Install from PyPI using `pip`. pip install zencoder @@ -13,19 +13,26 @@ Install from PyPI using `easy_install` or `pip`. ## Usage +### Create an instance of `Zencoder` + from zencoder import Zencoder zen = Zencoder('abc123') # enter your api key +### Submit a job + # creates an encoding job with the defaults job = zen.job.create('http://input-file/movie.avi') print job.code print job.body print job.body['id'] +### Return output progress + # get the transcode progress of the first output progress = zen.output.progress(job.body['outputs'][0]['id']) print progress.body +### Create a new job with multiple outputs # configure your outputs with dictionaries iphone = { @@ -39,11 +46,20 @@ Install from PyPI using `easy_install` or `pip`. 'url': 's3://output-bucket/output-file.vp8', 'video_codec':, 'vp8' } + # the outputs kwarg requires an iterable outputs = (iphone, web) another_job = zen.job.create(input_url, outputs=outputs) -**Note:** If you set the `ZENCODER_API_KEY` environment variable to your api key, you don't have to provide it when initializing Zencoder. +### ZENCODER_API_KEY Environment Variable + +```python +import os +os.environ['ZENCODER_API_KEY'] = 'abcd1234' +zen = Zencoder() +``` + +If you set `ZENCODER_API_KEY` to your API Key, you don't have to provide it when initializing Zencoder. ## Specifying the API Version Set the version of the Zencoder API you want to use as the `api_version` keyword to the `Zencoder` object (defaults to `v2`): From b9245417c60d3f5e4271b0919741e0ad66369cca Mon Sep 17 00:00:00 2001 From: Alex Schworer Date: Wed, 5 Jun 2013 18:11:29 -0700 Subject: [PATCH 3/6] Update README to reflect node library --- README.md | 200 ++++++++++++++++++++---------------------------------- 1 file changed, 73 insertions(+), 127 deletions(-) diff --git a/README.md b/README.md index 9322a1c..e21d29b 100644 --- a/README.md +++ b/README.md @@ -1,66 +1,35 @@ -# Zencoder -[![Build Status](https://travis-ci.org/zencoder/zencoder-py.png?branch=master)](https://travis-ci.org/zencoder/zencoder-py) - -A Python module for the [Zencoder](http://zencoder.com) API. - -## Installation -Install from PyPI using `easy_install` or `pip`. - - pip install zencoder - -## Dependencies -`zencoder-py` depends on [requests](http://python-requests.org), and uses the `json` or `simplejson` module. +Zencoder +---- -## Usage +[![Build Status](https://travis-ci.org/zencoder/zencoder-py.png?branch=master)](https://travis-ci.org/zencoder/zencoder-py) - from zencoder import Zencoder - zen = Zencoder('abc123') # enter your api key +A Python module for interacting with the [Zencoder](http://zencoder.com) API. - # creates an encoding job with the defaults - job = zen.job.create('http://input-file/movie.avi') - print job.code - print job.body - print job.body['id'] +### Getting Started - # get the transcode progress of the first output - progress = zen.output.progress(job.body['outputs'][0]['id']) - print progress.body +Install from PyPI + $ pip install zencoder - # configure your outputs with dictionaries - iphone = { - 'label': 'iPhone', - 'url': 's3://output-bucket/output-file-1.mp4', - 'width': 480, - 'height': 320 - } - web = { - 'label': 'web', - 'url': 's3://output-bucket/output-file.vp8', - 'video_codec':, 'vp8' - } - # the outputs kwarg requires an iterable - outputs = (iphone, web) - another_job = zen.job.create(input_url, outputs=outputs) +Import zencoder -**Note:** If you set the `ZENCODER_API_KEY` environment variable to your api key, you don't have to provide it when initializing Zencoder. +```python +from zencoder import Zencoder +``` -## Specifying the API Version -Set the version of the Zencoder API you want to use as the `api_version` keyword to the `Zencoder` object (defaults to `v2`): +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'. -```python -# set to version 1: https://app.zencoder.com/api/v1/ -zen = Zencoder(api_version='v1') + # If you want to specify an API key when creating a client + client = Zencoder('API_KEY') -# set to the edge version: https://app.zencoder.com/api/ -zen = Zencoder(api_version='edge') -``` + # If you have the environment variable set + client = Zencoder() -## Jobs +## [Jobs](https://app.zencoder.com/docs/api/jobs) There's more you can do on jobs than anything else in the API. The following methods are available: `list`, `create`, `details`, `progress`, `resubmit`, `cancel`, `delete`. -### create +Create a [new job](https://app.zencoder.com/docs/api/jobs/create). ```python zen.job.create('s3://bucket/key.mp4') @@ -77,7 +46,7 @@ response.code # 201 response.body['id'] # 12345 ``` -### list +[List jobs](https://app.zencoder.com/docs/api/jobs/list). 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`. @@ -86,7 +55,7 @@ zen.job.list(per_page=10) zen.job.list(per_page=10, page=2) ``` -### details +Get [details](https://app.zencoder.com/docs/api/jobs/show) about a job. The number passed to `details` is the ID of a Zencoder job. @@ -94,7 +63,7 @@ The number passed to `details` is the ID of a Zencoder job. zen.job.details(1) ``` -### progress +Get [progress](https://app.zencoder.com/docs/api/jobs/progress) on a job. The number passed to `progress` is the ID of a Zencoder job. @@ -102,7 +71,7 @@ The number passed to `progress` is the ID of a Zencoder job. zen.job.progress(1) ``` -### resubmit +[Resubmit](https://app.zencoder.com/docs/api/jobs/resubmit) a job The number passed to `resubmit` is the ID of a Zencoder job. @@ -110,7 +79,7 @@ The number passed to `resubmit` is the ID of a Zencoder job. zen.job.resubmit(1) ``` -### cancel +[Cancel](https://app.zencoder.com/docs/api/jobs/cancel) a job The number passed to `cancel` is the ID of a Zencoder job. @@ -126,9 +95,9 @@ The number passed to `delete` is the ID of a Zencoder job. zen.job.delete(1) ``` -## Inputs +## [Inputs](https://app.zencoder.com/docs/api/inputs) -### details +Get [details](https://app.zencoder.com/docs/api/inputs/show) about an input. The number passed to `details` is the ID of a Zencoder job. @@ -136,7 +105,7 @@ The number passed to `details` is the ID of a Zencoder job. zen.input.details(1) ``` -### progress +Get [progress](https://app.zencoder.com/docs/api/inputs/progress) for an input. The number passed to `progress` is the ID of a Zencoder job. @@ -144,9 +113,9 @@ The number passed to `progress` is the ID of a Zencoder job. zen.input.progress(1) ``` -## Outputs +## [Outputs](https://app.zencoder.com/docs/api/outputs) -### details +Get [details](https://app.zencoder.com/docs/api/outputs/show) about an output. The number passed to `details` is the ID of a Zencoder job. @@ -154,7 +123,7 @@ The number passed to `details` is the ID of a Zencoder job. zen.output.details(1) ``` -### progress +Get [progress](https://app.zencoder.com/docs/api/outputs/progress) for an output. The number passed to `progress` is the ID of a Zencoder job. @@ -162,61 +131,24 @@ The number passed to `progress` is the ID of a Zencoder job. zen.output.progress(1) ``` -## Accounts +## [Reports](https://app.zencoder.com/docs/api/reports) -### create +Reports are great for getting usage data for your account. All default to 30 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. -No API Key is required. - -```python -zen.account.create('foo@example.com', tos=1) -zen.account.create('foo@example.com', tos=1, - options={'password': 'abcd1234', - 'affiliate_code': 'foo'}) -``` - -### details - -```python -zen.account.details() -``` - -### integration - -This will put your account into integration mode (site-wide). - -```python -zen.account.integration() -``` - -### live - -This will put your account into live mode (site-wide). - -```python -zen.account.live() -``` - -## Reports - -### minutes - -This will list the minutes used for your account within a certain, configurable range. +Get [all usage](https://app.zencoder.com/docs/api/reports/all) (Live + VOD). ```python import datetime -zen.report.minutes() -zen.report.minutes(grouping="foo") -zen.report.minutes(start_date=datetime.date(2011, 10, 30), - end_date=datetime.date(2011, 11, 24)) -zen.report.minutes(start_date=datetime.date(2011, 10, 30), - end_date=datetime.date(2011, 11, 24), - grouping="foo") +zen.report.all() +zen.report.all(grouping="foo") +zen.report.all(start_date=datetime.date(2011, 10, 30), + end_date=datetime.date(2011, 11, 24)) +zen.report.all(start_date=datetime.date(2011, 10, 30), + end_date=datetime.date(2011, 11, 24), + grouping="foo") ``` -### vod - -This will list the VOD minutes used for your account. +Get [VOD usage](https://app.zencoder.com/docs/api/reports/vod). ```python import datetime @@ -229,9 +161,7 @@ zen.report.vod(start_date=datetime.date(2011, 10, 30), grouping="foo") ``` -### live - -This will list the Live transcoding minutes used for your account. +Get [Live usage](https://app.zencoder.com/docs/api/reports/live). ```python import datetime @@ -244,27 +174,43 @@ zen.report.live(start_date=datetime.date(2011, 10, 30), grouping="foo") ``` -### all +## [Accounts](https://app.zencoder.com/docs/api/accounts) -This will list all of the transcoding minutes used for your account. +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. + +No API Key is required. ```python -import datetime -zen.report.all() -zen.report.all(grouping="foo") -zen.report.all(start_date=datetime.date(2011, 10, 30), - end_date=datetime.date(2011, 11, 24)) -zen.report.all(start_date=datetime.date(2011, 10, 30), - end_date=datetime.date(2011, 11, 24), - grouping="foo") +zen.account.create('foo@example.com', tos=1) +zen.account.create('foo@example.com', tos=1, + options={'password': 'abcd1234', + 'affiliate_code': 'foo'}) +``` + +Get [details](https://app.zencoder.com/docs/api/accounts/show) about the current account. + +```python +zen.account.details() ``` -## Documentation -Docs are in progress, and hosted at Read the Docs: http://zencoder.rtfd.org +Turn [integration mode](https://app.zencoder.com/docs/api/accounts/integration) on (all jobs are test jobs). + +```python +zen.account.integration() +``` + +Turn off integration mode, which means your account is live (and you'll be billed for jobs). + +```python +zen.account.live() +``` +## Tests + +The tests use the `mock` library to stub in response data from the API. Run tests individually: + + $ python test/test_jobs.py -## Contributors - * [Senko Rasic](http://github.com/senko) - * [Josh Kennedy](http://github.com/kennedyj) - * [Issac Kelly](http://github.com/issackelly) +Or use `nose`: + $ nosetests From b422a7ad13ed9ce16ba3b37de193565e56609d0e Mon Sep 17 00:00:00 2001 From: Alex Schworer Date: Wed, 5 Jun 2013 18:15:13 -0700 Subject: [PATCH 4/6] remove old junk --- README.md | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) diff --git a/README.md b/README.md index c6c66c3..2d2619d 100644 --- a/README.md +++ b/README.md @@ -17,55 +17,6 @@ Import zencoder ```python from zencoder import Zencoder ``` -======= -### Create an instance of `Zencoder` - - from zencoder import Zencoder - zen = Zencoder('abc123') # enter your api key - -### Submit a job - - # creates an encoding job with the defaults - job = zen.job.create('http://input-file/movie.avi') - print job.code - print job.body - print job.body['id'] - -### Return output progress - - # get the transcode progress of the first output - progress = zen.output.progress(job.body['outputs'][0]['id']) - print progress.body - -### Create a new job with multiple outputs - - # configure your outputs with dictionaries - iphone = { - 'label': 'iPhone', - 'url': 's3://output-bucket/output-file-1.mp4', - 'width': 480, - 'height': 320 - } - web = { - 'label': 'web', - 'url': 's3://output-bucket/output-file.vp8', - 'video_codec':, 'vp8' - } - - # the outputs kwarg requires an iterable - outputs = (iphone, web) - another_job = zen.job.create(input_url, outputs=outputs) - -### ZENCODER_API_KEY Environment Variable - -```python -import os -os.environ['ZENCODER_API_KEY'] = 'abcd1234' -zen = Zencoder() -``` - -If you set `ZENCODER_API_KEY` to your API Key, you don't have to provide it when initializing Zencoder. ->>>>>>> a1728bd03ce089174715cf2e83ea6ead7e13a405 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'. From 87744bc6c402a7e37393103c95a5c43ac7f78e67 Mon Sep 17 00:00:00 2001 From: Alex Schworer Date: Wed, 5 Jun 2013 18:18:20 -0700 Subject: [PATCH 5/6] remove unneeded stuff --- README.md | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/README.md b/README.md index 2d2619d..dc69a81 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,6 @@ Create an instance of the Zencoder client. This will accept an API key and versi ## [Jobs](https://app.zencoder.com/docs/api/jobs) -There's more you can do on jobs than anything else in the API. The following methods are available: `list`, `create`, `details`, `progress`, `resubmit`, `cancel`, `delete`. - Create a [new job](https://app.zencoder.com/docs/api/jobs/create). ```python @@ -85,15 +83,6 @@ zen.job.resubmit(1) The number passed to `cancel` is the ID of a Zencoder job. ```python -zen.job.cancel(1) -``` - -### delete - -The number passed to `delete` is the ID of a Zencoder job. - -```python -zen.job.delete(1) ``` ## [Inputs](https://app.zencoder.com/docs/api/inputs) From 15c747fbc4e156cfb6f3339e46eca5cf71056b11 Mon Sep 17 00:00:00 2001 From: Alex Schworer Date: Wed, 5 Jun 2013 18:18:35 -0700 Subject: [PATCH 6/6] s/zen/client --- README.md | 59 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index dc69a81..5b5dc45 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,8 @@ Create an instance of the Zencoder client. This will accept an API key and versi Create a [new job](https://app.zencoder.com/docs/api/jobs/create). ```python -zen.job.create('s3://bucket/key.mp4') -zen.job.create('s3://bucket/key.mp4', +client.job.create('s3://bucket/key.mp4') +client.job.create('s3://bucket/key.mp4', outputs=[{'label': 'vp8 for the web', 'url': 's3://bucket/key_output.webm'}]) ``` @@ -40,7 +40,7 @@ zen.job.create('s3://bucket/key.mp4', This returns a `zencoder.Response` object. The body includes a Job ID, and one or more Output IDs (one for every output file created). ```python -response = zen.job.create('s3://bucket/key.mp4') +response = client.job.create('s3://bucket/key.mp4') response.code # 201 response.body['id'] # 12345 ``` @@ -50,8 +50,8 @@ response.body['id'] # 12345 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`. ```python -zen.job.list(per_page=10) -zen.job.list(per_page=10, page=2) +client.job.list(per_page=10) +client.job.list(per_page=10, page=2) ``` Get [details](https://app.zencoder.com/docs/api/jobs/show) about a job. @@ -59,7 +59,7 @@ Get [details](https://app.zencoder.com/docs/api/jobs/show) about a job. The number passed to `details` is the ID of a Zencoder job. ```python -zen.job.details(1) +client.job.details(1) ``` Get [progress](https://app.zencoder.com/docs/api/jobs/progress) on a job. @@ -67,7 +67,7 @@ Get [progress](https://app.zencoder.com/docs/api/jobs/progress) on a job. The number passed to `progress` is the ID of a Zencoder job. ```python -zen.job.progress(1) +client.job.progress(1) ``` [Resubmit](https://app.zencoder.com/docs/api/jobs/resubmit) a job @@ -75,7 +75,7 @@ zen.job.progress(1) The number passed to `resubmit` is the ID of a Zencoder job. ```python -zen.job.resubmit(1) +client.job.resubmit(1) ``` [Cancel](https://app.zencoder.com/docs/api/jobs/cancel) a job @@ -83,6 +83,7 @@ zen.job.resubmit(1) The number passed to `cancel` is the ID of a Zencoder job. ```python +client.job.cancel(1) ``` ## [Inputs](https://app.zencoder.com/docs/api/inputs) @@ -92,7 +93,7 @@ Get [details](https://app.zencoder.com/docs/api/inputs/show) about an input. The number passed to `details` is the ID of a Zencoder job. ```python -zen.input.details(1) +client.input.details(1) ``` Get [progress](https://app.zencoder.com/docs/api/inputs/progress) for an input. @@ -100,7 +101,7 @@ Get [progress](https://app.zencoder.com/docs/api/inputs/progress) for an input. The number passed to `progress` is the ID of a Zencoder job. ```python -zen.input.progress(1) +client.input.progress(1) ``` ## [Outputs](https://app.zencoder.com/docs/api/outputs) @@ -110,7 +111,7 @@ Get [details](https://app.zencoder.com/docs/api/outputs/show) about an output. The number passed to `details` is the ID of a Zencoder job. ```python -zen.output.details(1) +client.output.details(1) ``` Get [progress](https://app.zencoder.com/docs/api/outputs/progress) for an output. @@ -118,7 +119,7 @@ Get [progress](https://app.zencoder.com/docs/api/outputs/progress) for an output The number passed to `progress` is the ID of a Zencoder job. ```python -zen.output.progress(1) +client.output.progress(1) ``` ## [Reports](https://app.zencoder.com/docs/api/reports) @@ -129,11 +130,11 @@ Get [all usage](https://app.zencoder.com/docs/api/reports/all) (Live + VOD). ```python import datetime -zen.report.all() -zen.report.all(grouping="foo") -zen.report.all(start_date=datetime.date(2011, 10, 30), +client.report.all() +client.report.all(grouping="foo") +client.report.all(start_date=datetime.date(2011, 10, 30), end_date=datetime.date(2011, 11, 24)) -zen.report.all(start_date=datetime.date(2011, 10, 30), +client.report.all(start_date=datetime.date(2011, 10, 30), end_date=datetime.date(2011, 11, 24), grouping="foo") ``` @@ -142,11 +143,11 @@ Get [VOD usage](https://app.zencoder.com/docs/api/reports/vod). ```python import datetime -zen.report.vod() -zen.report.vod(grouping="foo") -zen.report.vod(start_date=datetime.date(2011, 10, 30), +client.report.vod() +client.report.vod(grouping="foo") +client.report.vod(start_date=datetime.date(2011, 10, 30), end_date=datetime.date(2011, 11, 24)) -zen.report.vod(start_date=datetime.date(2011, 10, 30), +client.report.vod(start_date=datetime.date(2011, 10, 30), end_date=datetime.date(2011, 11, 24), grouping="foo") ``` @@ -155,11 +156,11 @@ Get [Live usage](https://app.zencoder.com/docs/api/reports/live). ```python import datetime -zen.report.live() -zen.report.live(grouping="foo") -zen.report.live(start_date=datetime.date(2011, 10, 30), +client.report.live() +client.report.live(grouping="foo") +client.report.live(start_date=datetime.date(2011, 10, 30), end_date=datetime.date(2011, 11, 24)) -zen.report.live(start_date=datetime.date(2011, 10, 30), +client.report.live(start_date=datetime.date(2011, 10, 30), end_date=datetime.date(2011, 11, 24), grouping="foo") ``` @@ -171,8 +172,8 @@ Create a [new account](https://app.zencoder.com/docs/api/accounts/create). A uni No API Key is required. ```python -zen.account.create('foo@example.com', tos=1) -zen.account.create('foo@example.com', tos=1, +client.account.create('foo@example.com', tos=1) +client.account.create('foo@example.com', tos=1, options={'password': 'abcd1234', 'affiliate_code': 'foo'}) ``` @@ -180,19 +181,19 @@ zen.account.create('foo@example.com', tos=1, Get [details](https://app.zencoder.com/docs/api/accounts/show) about the current account. ```python -zen.account.details() +client.account.details() ``` Turn [integration mode](https://app.zencoder.com/docs/api/accounts/integration) on (all jobs are test jobs). ```python -zen.account.integration() +client.account.integration() ``` Turn off integration mode, which means your account is live (and you'll be billed for jobs). ```python -zen.account.live() +client.account.live() ``` ## Tests