Official Scaledrone Python API client. This is a wrapper around the REST API.
pip install scaledrone
Create a new instance of Scaledrone passing it the channel_id
and secret_key
that you can find from the Scaledrone dashboard channel's page.
from scaledrone import Scaledrone
drone = Scaledrone('channel_id', 'secret_key')
room = 'notifications'
message = {'foo': 'bar'}
response = drone.publish(room, message)
rooms = ['room1', 'room2']
message = {'foo': 'bar'}
response = drone.publish(rooms, message)
response = drone.channel_stats()
print(response.json()) # {users_count: 10}
response = drone.members_list()
print(response.json()) # ["user1", "user2"]
response = drone.rooms_list()
print(response.json()) # ["room1", "room2"]
response = drone.room_members_list('my-room')
print(response.json()) # ["user3", "user4"]
response = drone.all_room_members_list()
print(response.json()) # {"room1": ["user1", "user2"], "room2": ["user1"]}
The API returns Requests responses.
python test.py
Update setup.py
with the new version. Then upload it:
python setup.py sdist upload -r pypi
0.2.0
Implemented latest REST API endpoints. Send data as JSON.0.1.0
Initial version