Ably.io python client library - REST interface
The ably-python client has one dependency, requests>=1.0.0
- Connection Pooling
- HTTP Keep-Alive
- Python 2.6-3.3
- Compatible with gevent
pip install ably-python
pip install -e git+https://github.com/ably/ably-python#egg=AblyPython
git clone https://github.com/ably/ably-python.git
cd ably-python
python setup.py install
python setup.py test
from ably.rest import AblyRest
ably = AblyRest("key_str")
ably.time() # returns the server time in ms since the unix epoch
ably.stats() # returns an array of stats
# Channels:
# Publish a message to channel 'foo'
ably.channels.foo.publish('msg_name', 'msg_data')
# Get the history for channel 'foo'
ably.channels.foo.history()
# Get presence for channel 'foo'
ably.channels.foo.presence()
You can provide either a key
string or app_id
+ key_id
+ key_value
combination.
ably = AblyRest("key-string")
or
ably = AblyRest(app_id="app-id", key_id="key-id", key_value="key-value")