Skip to content

cine-io/cineio-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cine.io python egg

Build Status

The python egg for cine.io.

Installation

install cine_io via pip:

pip install cine_io

Usage

Initialization

import cine_io
client = cine_io.Client({"secretKey": "CINE_IO_SECRET_KEY"})
client = cine_io.Client({"secretKey": "CINE_IO_SECRET_KEY", "masterKey": "CINE_IO_MASTER_KEY"})

Methods

Projects

To get data about your projects:

project = client.projects.index()
# => [cine_io.Project, …]

Project

To get data about your project:

project = client.project.get()
# => cine_io.Project

To update your project:

project = client.project.update({"name": 'new project name'})
# => cine_io.Project

To delete your project:

deleted_at = client.project.delete()
# => String of datetime when the project was deleted

Streams

To get all your streams:

streams = client.streams.index()
streams = client.streams.index({"name": "my custom name"})
# => [cine_io.Stream, …]

To get a specific stream:

stream = client.streams.get('STREAM_ID')
# => cine_io.Stream

To create a new stream:

stream = client.streams.create()
# => cine_io.Stream
# you can optionally pass params
# params
#  name: 'a stream name'
#  record: True|False (default False). record: True will save recordings of all streaming sessions

stream = client.streams.create({"name": 'new stream name'})
# => cine_io.Stream

To update a specific stream:

# params:
#  'name': 'some stream name'
#  record: True|False (updating a stream from true to false will not delete old stream recordings)
stream = client.streams.update('STREAM_ID', params)
# => cine_io.Stream

To fetch the Flash Media Live Encoder profile for a stream:

stream = client.streams.fmle_profile('STREAM_ID')
# => String of profile contents

To delete a stream:

stream = client.streams.delete('STREAM_ID')
# => String of datetime when the stream was deleted

Stream Recordings

To get all the recordings of stream:

recordings = client.streams.recordings.index('STREAM_ID')
# => [cine_io.StreamRecording, …]

To delete a recordings of stream:

recordings = client.streams.recordings.delete('STREAM_ID', 'recordingName')
# => String of datetime when the stream recording was deleted

Peer

Identity Signature Generation

var identity = "Unique user name to your app"
response = client.peer.generate_identity_signature(identity)
# response looks like {'signature': "sha1-hash", 'timestamp': 1420258111, 'identity': "Unique user name to your app"}

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request