Skip to main content

A Python 3 interface to the XirSys API.

Project description

A Python 3 interface to the XirSys API



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

Generate a XirSys WebSocket token:

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

Grab a list of XirSys ICE servers:

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

Manage XirSys domains:

>>> from python_xirsys.objects import Domain
>>> Domain.create(connection=connection, domain="")
<Domain []>
>>> Domain.list_all(connection=connection)
[<Domain []>, <Domain []>]
>>> domains = Domain.list_all(connection=connection)
>>> domain = domains[domains.index("")]
>>> 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("")]
>>> 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="")
[<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="", application="default", room="test_room")
<Room [test_room]>
>>> rooms = Room.list_all(connection=connection, domain="", application="default")
[<Room [default]>, <Room [test_room]>]
>>> room = rooms[rooms.index("test_room")]

Running the Tests

pip install -r requirements/test.txt


0.1.1 (2016-05-30)

  • Object names are now coerced to strings when initialized to avoid a TypeError

0.1.0 (2016-05-26)

  • 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.1.tar.gz (7.7 kB view hashes)

Uploaded source

Built Distribution

python_xirsys-0.1.1-py2.py3-none-any.whl (7.9 kB view hashes)

Uploaded 3 4

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page