Skip to main content

A Python 3 interface to the XirSys API.

Project description

A Python 3 interface to the XirSys API

Badges

https://img.shields.io/travis/kavdev/python-xirsys/master.svg?style=flat-square https://img.shields.io/codecov/c/github/kavdev/python-xirsys/master.svg?style=flat-square https://img.shields.io/requires/github/kavdev/python-xirsys.svg?style=flat-square https://img.shields.io/codacy/fd05754e919f4a18b4cfada7ef9632fa.svg?style=flat-square https://img.shields.io/pypi/v/python-xirsys.svg?style=flat-square https://img.shields.io/pypi/dw/python-xirsys.svg?style=flat-square https://img.shields.io/github/issues/kavdev/python-xirsys.svg?style=flat-square https://img.shields.io/github/license/kavdev/python-xirsys.svg?style=flat-square

Usage

Install python-xirsys:

pip install python-xirsys

Build a Connection object:

from python-xirsys import Connection

connection = Connection(username="<xirsys_username>", secret_key="<xirsys_secret_key>"

Grab XirSys signaling server:

>>> SignalingServer.list_all(connection=connection)
<SignalingServer [server_address]>
>>> server = SignalingServer.list_all(connection=connection)
>>> server.address
'<server_address>'

Generate a XirSys WebSocket token:

>>> from python_xirsys.objects import SignalingServer
>>> SignalingServer.generate_token(connection=connection, domain="domain.com", application="application", room="room", secure=True)
'<token>'

Grab a list of XirSys ICE servers:

>>> from python_xirsys.objects import ICEServer
>>> ICEServer.list_all(connection=connection, domain="domain.com", application="application", room="room", secure=True, timeout=30)
[<ICEServer [url]>, ...]
>>> ice_servers = ICEServer.list_all(connection=connection, domain="domain.com", application="application", room="room", secure=True, timeout=30)
>>> ice_server = ice_servers[0]
>>> ice_server.url
'<url>'
>>> ice_server.server_type
'stun'
>>> ice_server.username
None
>>> ice_server.credential
None
>>> ice_server = ice_servers[1]
>>> ice_server.url
'<url>'
>>> ice_server.server_type
'turn'
>>> ice_server.username
'<username>'
>>> ice_server.credential
'<credential>'

Manage XirSys domains:

>>> from python_xirsys.objects import Domain
>>> Domain.create(connection=connection, domain="test.com")
<Domain [test.com]>
>>> Domain.list_all(connection=connection)
[<Domain [domain.com]>, <Domain [test.com]>]
>>> domains = Domain.list_all(connection=connection)
>>> domain = domains[domains.index("test.com")]
>>> domain.applications
[<Application [default]>, ...]
>>> domain.disable()

Manage XirSys applications:

>>> from python_xirsys.objects import Application
>>> domains = Domain.list_all(connection=connection)
>>> domain = domains[domains.index("domain.com")]
>>> Application.create(connection=connection, domain=domain, application="test")
<Application [test]>
>>> Application.list_all(connection=connection, domain=domain)
[<Application [default]>, <Application [test]>]
>>> Application.list_all(connection=connection, domain="domain.com")
[<Application [default]>, <Application [test]>]
>>> applications = Application.list_all(connection=connection, domain=domain)
>>> application = applications[applications.index("test")]
>>> application.rooms
[<Room [default]>, ...]
>>> application.disable()

Manage XirSys rooms:

>>> from python_xirsys.objects import Room
>>> Room.create(connection=connection, domain="domain.com", application="default", room="test_room")
<Room [test_room]>
>>> rooms = Room.list_all(connection=connection, domain="domain.com", application="default")
[<Room [default]>, <Room [test_room]>]
>>> room = rooms[rooms.index("test_room")]
>>> application.room()

Running the Tests

pip install -r requirements/test.txt
./runtests.py

Changes

0.1.0 (2016-05-??)

  • Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-xirsys-0.1.0.dev0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

python_xirsys-0.1.0.dev0-py2.py3-none-any.whl (7.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file python-xirsys-0.1.0.dev0.tar.gz.

File metadata

File hashes

Hashes for python-xirsys-0.1.0.dev0.tar.gz
Algorithm Hash digest
SHA256 dcb9f9456c61928de31d15d9be1512095da98b9ff0456dfccc4b2b7bb1e590f8
MD5 cb41951c97ecb4635b516ad09530d2f1
BLAKE2b-256 c7793ec17795698554a3a16af210d7013da91f9f4f72dee5fc39d43f5c4feda4

See more details on using hashes here.

File details

Details for the file python_xirsys-0.1.0.dev0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for python_xirsys-0.1.0.dev0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ed55c3c96f6b9aa1cb6106ccab68166e756010f88897072a986d237fbe62a812
MD5 a6a3be2dd29efdaec3c513e5693acb1b
BLAKE2b-256 f23425a9aaa7684d3aa541c8bb36ee774f8576d4f5f01208880c8632089cf51b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page