A Python 3 interface to the XirSys API.
Project description
A Python 3 interface to the XirSys API
Badges
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-26)
Initial release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file python-xirsys-0.1.0.post1.tar.gz
.
File metadata
- Download URL: python-xirsys-0.1.0.post1.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7d19cc36ceb14dfc129124f97e7d1cfa88fe4241cb4bc0dc947e2bbbe13f0da |
|
MD5 | fda0edb1263e014232a6db11ecee511d |
|
BLAKE2b-256 | e3b3757edba3a169d799ce699009164456a8c7ed1c38cc8633bc80ce4baae578 |
File details
Details for the file python_xirsys-0.1.0.post1-py2.py3-none-any.whl
.
File metadata
- Download URL: python_xirsys-0.1.0.post1-py2.py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71e7cdf0afb182fb4ce3678dfc02005ae30936f5f663ceafef263690cd2919be |
|
MD5 | 401cd2851246e00066f9e03b30f2f4c3 |
|
BLAKE2b-256 | 35679b784f3a096efbc06e0be6d86e60261519ab5c4a9a271b3d0bf8602b292b |