Skip to content

Use Requests instead of httplib2 #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
May 21, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ language: python
python:
- "2.6"
- "2.7"
- "3.3"
- "pypy"
install: pip install -e .
# command to run tests
script: python test/test_zencoder.py
script: nosetests

6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# Zencoder
[![Build Status](https://secure.travis-ci.org/schworer/zencoder-py.png)](http://travis-ci.org/schworer/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 [httplib2](http://code.google.com/p/httplib2/), and uses the `json` or `simplejson` module.
`zencoder-py` depends on [requests](http://python-requests.org), and uses the `json` or `simplejson` module.

## Usage

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

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

22 changes: 18 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

from distutils.core import setup
try:
from setuptools import setup
except ImportError:
from distutils.core import setup

setup(name='zencoder',
version='0.5.2',
Expand All @@ -8,7 +10,19 @@
author_email='alex.schworer@gmail.com',
url='http://github.com/schworer/zencoder-py',
license="MIT License",
install_requires=['httplib2'],
packages=['zencoder']
install_requires=['requests>=1.0'],
tests_require=['mock', 'nose'],
packages=['zencoder'],
platforms='any',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Topic :: Software Development :: Libraries :: Python Modules'
]
)

4 changes: 4 additions & 0 deletions test/fixtures/account_create.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"api_key": "abcd1234",
"password": "foo"
}
8 changes: 8 additions & 0 deletions test/fixtures/account_details.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"account_state": "active",
"plan": "Growth",
"minutes_used": 12549,
"minutes_included": 25000,
"billing_state": "active",
"integration_mode":true
}
10 changes: 10 additions & 0 deletions test/fixtures/job_create.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"outputs": [
{
"label": null,
"url": "https://zencoder-temp-storage-us-east-1.s3.amazonaws.com/o/20130505/7a9f3b6947c27305079fb105dbfc529e/34356e4d54f0c8fb9c3273203937e795.mp4?AWSAccessKeyId=AKIAI456JQ76GBU7FECA&Signature=Tp9WVinpXKE%2FPrP2M08r54U4EQ0%3D&Expires=1367817210",
"id": 93461812
}
],
"id": 45492475
}
12 changes: 12 additions & 0 deletions test/fixtures/job_create_live.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"stream_url": "rtmp://foo:1935/live",
"stream_name": "bar",
"outputs": [
{
"label": null,
"url": "https://zencoder-temp-storage-us-east-1.s3.amazonaws.com",
"id": 97931084
}
],
"id": 47010105
}
69 changes: 69 additions & 0 deletions test/fixtures/job_details.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"job": {
"submitted_at": "2013-05-04T21:36:39-07:00",
"state": "finished",
"privacy": false,
"input_media_file": {
"video_codec": "h264",
"frame_rate": 30,
"channels": "2",
"audio_codec": "aac",
"audio_bitrate_in_kbps": 50,
"state": "finished",
"format": "mpeg4",
"audio_sample_rate": 44100,
"privacy": false,
"height": 720,
"error_message": null,
"url": "s3://test-bucket/test.mov",
"video_bitrate_in_kbps": 1402,
"md5_checksum": null,
"duration_in_ms": 5067,
"test": false,
"id": 45469002,
"finished_at": "2013-05-04T21:36:46-07:00",
"updated_at": "2013-05-04T21:37:12-07:00",
"created_at": "2013-05-04T21:36:39-07:00",
"total_bitrate_in_kbps": 1452,
"width": 1280,
"error_class": null,
"file_size_bytes": 922620
},
"test": false,
"id": 45491013,
"finished_at": "2013-05-04T21:37:12-07:00",
"updated_at": "2013-05-04T21:37:12-07:00",
"created_at": "2013-05-04T21:36:39-07:00",
"thumbnails": [],
"output_media_files": [
{
"video_codec": "h264",
"frame_rate": 30,
"channels": "2",
"audio_codec": "aac",
"audio_bitrate_in_kbps": 90,
"state": "finished",
"format": "mpeg4",
"audio_sample_rate": 44100,
"label": null,
"privacy": false,
"height": 720,
"error_message": null,
"url": "https://zencoder-temp-storage-us-east-1.s3.amazonaws.com/o/20130505/fc7f7df4f3eacd6fe4ee88cab28732de/dfc2f1b4eb49ea9ab914c84de6d392fb.mp4?AWSAccessKeyId=AKIAI456JQ76GBU7FECA&Signature=lAc18iXd4ta1Ct0JyazKwYSwdOk%3D&Expires=1367815032",
"video_bitrate_in_kbps": 1440,
"md5_checksum": null,
"duration_in_ms": 5130,
"test": false,
"id": 93457943,
"finished_at": "2013-05-04T21:37:12-07:00",
"updated_at": "2013-05-04T21:37:12-07:00",
"created_at": "2013-05-04T21:36:39-07:00",
"total_bitrate_in_kbps": 1530,
"width": 1280,
"error_class": null,
"file_size_bytes": 973430
}
],
"pass_through": null
}
}
Loading