Skip to content

Commit dbda8e9

Browse files
committed
Merge pull request #18 from schworer/requests-http
Use Requests instead of httplib2
2 parents 7907cfd + 05d0d18 commit dbda8e9

20 files changed

+1068
-134
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ language: python
22
python:
33
- "2.6"
44
- "2.7"
5+
- "3.3"
6+
- "pypy"
57
install: pip install -e .
68
# command to run tests
7-
script: python test/test_zencoder.py
9+
script: nosetests
10+

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# Zencoder
2+
[![Build Status](https://secure.travis-ci.org/schworer/zencoder-py.png)](http://travis-ci.org/schworer/zencoder-py)
23

34
A Python module for the [Zencoder](http://zencoder.com) API.
45

56
## Installation
67
Install from PyPI using `easy_install` or `pip`.
78

9+
pip install zencoder
10+
811
## Dependencies
9-
`zencoder-py` depends on [httplib2](http://code.google.com/p/httplib2/), and uses the `json` or `simplejson` module.
12+
`zencoder-py` depends on [requests](http://python-requests.org), and uses the `json` or `simplejson` module.
1013

1114
## Usage
1215

@@ -60,5 +63,4 @@ Docs are in progress, and hosted at Read the Docs: http://zencoder.rtfd.org
6063
* [Josh Kennedy](http://github.com/kennedyj)
6164
* [Issac Kelly](http://github.com/issackelly)
6265

63-
[![Build Status](https://secure.travis-ci.org/schworer/zencoder-py.png)](http://travis-ci.org/schworer/zencoder-py)
6466

setup.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
2-
from distutils.core import setup
1+
try:
2+
from setuptools import setup
3+
except ImportError:
4+
from distutils.core import setup
35

46
setup(name='zencoder',
57
version='0.5.2',
@@ -8,7 +10,19 @@
810
author_email='alex.schworer@gmail.com',
911
url='http://github.com/schworer/zencoder-py',
1012
license="MIT License",
11-
install_requires=['httplib2'],
12-
packages=['zencoder']
13+
install_requires=['requests>=1.0'],
14+
tests_require=['mock', 'nose'],
15+
packages=['zencoder'],
16+
platforms='any',
17+
classifiers=[
18+
'Development Status :: 4 - Beta',
19+
'Intended Audience :: Developers',
20+
'License :: OSI Approved :: MIT License',
21+
'Operating System :: OS Independent',
22+
'Programming Language :: Python',
23+
'Programming Language :: Python :: 2.6',
24+
'Programming Language :: Python :: 2.7',
25+
'Topic :: Software Development :: Libraries :: Python Modules'
26+
]
1327
)
1428

test/fixtures/account_create.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"api_key": "abcd1234",
3+
"password": "foo"
4+
}

test/fixtures/account_details.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"account_state": "active",
3+
"plan": "Growth",
4+
"minutes_used": 12549,
5+
"minutes_included": 25000,
6+
"billing_state": "active",
7+
"integration_mode":true
8+
}

test/fixtures/job_create.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"outputs": [
3+
{
4+
"label": null,
5+
"url": "https://zencoder-temp-storage-us-east-1.s3.amazonaws.com/o/20130505/7a9f3b6947c27305079fb105dbfc529e/34356e4d54f0c8fb9c3273203937e795.mp4?AWSAccessKeyId=AKIAI456JQ76GBU7FECA&Signature=Tp9WVinpXKE%2FPrP2M08r54U4EQ0%3D&Expires=1367817210",
6+
"id": 93461812
7+
}
8+
],
9+
"id": 45492475
10+
}

test/fixtures/job_create_live.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"stream_url": "rtmp://foo:1935/live",
3+
"stream_name": "bar",
4+
"outputs": [
5+
{
6+
"label": null,
7+
"url": "https://zencoder-temp-storage-us-east-1.s3.amazonaws.com",
8+
"id": 97931084
9+
}
10+
],
11+
"id": 47010105
12+
}

test/fixtures/job_details.json

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"job": {
3+
"submitted_at": "2013-05-04T21:36:39-07:00",
4+
"state": "finished",
5+
"privacy": false,
6+
"input_media_file": {
7+
"video_codec": "h264",
8+
"frame_rate": 30,
9+
"channels": "2",
10+
"audio_codec": "aac",
11+
"audio_bitrate_in_kbps": 50,
12+
"state": "finished",
13+
"format": "mpeg4",
14+
"audio_sample_rate": 44100,
15+
"privacy": false,
16+
"height": 720,
17+
"error_message": null,
18+
"url": "s3://test-bucket/test.mov",
19+
"video_bitrate_in_kbps": 1402,
20+
"md5_checksum": null,
21+
"duration_in_ms": 5067,
22+
"test": false,
23+
"id": 45469002,
24+
"finished_at": "2013-05-04T21:36:46-07:00",
25+
"updated_at": "2013-05-04T21:37:12-07:00",
26+
"created_at": "2013-05-04T21:36:39-07:00",
27+
"total_bitrate_in_kbps": 1452,
28+
"width": 1280,
29+
"error_class": null,
30+
"file_size_bytes": 922620
31+
},
32+
"test": false,
33+
"id": 45491013,
34+
"finished_at": "2013-05-04T21:37:12-07:00",
35+
"updated_at": "2013-05-04T21:37:12-07:00",
36+
"created_at": "2013-05-04T21:36:39-07:00",
37+
"thumbnails": [],
38+
"output_media_files": [
39+
{
40+
"video_codec": "h264",
41+
"frame_rate": 30,
42+
"channels": "2",
43+
"audio_codec": "aac",
44+
"audio_bitrate_in_kbps": 90,
45+
"state": "finished",
46+
"format": "mpeg4",
47+
"audio_sample_rate": 44100,
48+
"label": null,
49+
"privacy": false,
50+
"height": 720,
51+
"error_message": null,
52+
"url": "https://zencoder-temp-storage-us-east-1.s3.amazonaws.com/o/20130505/fc7f7df4f3eacd6fe4ee88cab28732de/dfc2f1b4eb49ea9ab914c84de6d392fb.mp4?AWSAccessKeyId=AKIAI456JQ76GBU7FECA&Signature=lAc18iXd4ta1Ct0JyazKwYSwdOk%3D&Expires=1367815032",
53+
"video_bitrate_in_kbps": 1440,
54+
"md5_checksum": null,
55+
"duration_in_ms": 5130,
56+
"test": false,
57+
"id": 93457943,
58+
"finished_at": "2013-05-04T21:37:12-07:00",
59+
"updated_at": "2013-05-04T21:37:12-07:00",
60+
"created_at": "2013-05-04T21:36:39-07:00",
61+
"total_bitrate_in_kbps": 1530,
62+
"width": 1280,
63+
"error_class": null,
64+
"file_size_bytes": 973430
65+
}
66+
],
67+
"pass_through": null
68+
}
69+
}

0 commit comments

Comments
 (0)