Skip to content

Commit 7d0fb69

Browse files
committed
Updated readme
1 parent a49b73d commit 7d0fb69

File tree

1 file changed

+78
-14
lines changed

1 file changed

+78
-14
lines changed

README.md

Lines changed: 78 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,49 @@
1-
# Pusher REST Python library
1+
# Pusher HTTP Python Library
22

33
![Travis-CI](https://travis-ci.org/pusher/pusher-http-python.svg)
44

55
*status: Alpha*
66

7-
This is the new python library that will replace the "pusher" module once it
8-
becomes stable enough.
7+
The new Python library for interacting with the Pusher HTTP API.
98

10-
In order to use this library, you need to have an account on
11-
http://pusher.com. After registering, you will need the application
12-
credentials for your app.
9+
This package lets you trigger events to your client and query the state of your Pusher channels. When used with a server, you can validate Pusher webhooks and authenticate private- or presence-channels.
10+
11+
In order to use this library, you need to have a free account on <http://pusher.com>. After registering, you will need the application credentials for your app.
1312

1413
Features
1514
--------
1615

1716
* Python 2.6, 2.7 and 3.3 support
18-
* Adapters for various http libraries like requests, aiohttp and tornado
17+
* Adapters for various http libraries like requests, urlfetch, aiohttp and tornado.
1918
* WebHook validation
2019
* Signature generation for socket subscriptions
2120

21+
###Table of Contents
22+
23+
- [Installation](#installation)
24+
- [Getting started](#getting-started)
25+
- [Configuration](#configuration)
26+
- [Triggering Events](#triggering-events)
27+
- [Querying Application State](#querying-application-state)
28+
- [Getting Information For All Channels](#getting-information-for-all-channels)
29+
- [Getting Information For A Specific Channel](#getting-information-for-a-specific-channel)
30+
- [Getting User Information For A Presence Channel](#getting-user-information-for-a-presence-channel)
31+
- [Authenticating Channel Subscription](#authenticating-channel-subscription)
32+
- [Receiving Webhooks](#receiving-webhooks)
33+
- [Request Library Configuration](#request-library-configuration)
34+
- [Google App Engine](#google-app-engine)
35+
- [Feature Support](#feature-support)
36+
- [Running the tests](#running-the-tests)
37+
- [License](#license)
38+
2239
Installation
2340
------------
2441

2542
You can install this module using your package management method or choice,
2643
normally `easy_install` or `pip`. For example:
2744

2845
```bash
29-
pip install pusher-rest
46+
pip install pusher
3047
```
3148

3249
**Note: When 1.0 is reached `pusher-rest` will no longer be updated. Instead `pusher` should be used**
@@ -36,7 +53,7 @@ Getting started
3653

3754
The minimum configuration required to use the Pusher object are the three
3855
constructor arguments which identify your Pusher app. You can find them by
39-
going to "API Keys" on your app at https://app.pusher.com.
56+
going to "API Keys" on your app at <https://app.pusher.com>.
4057

4158
```python
4259
from pusher import Pusher
@@ -54,7 +71,7 @@ pusher.trigger(u'a_channel', u'an_event', {u'some': u'data'})
5471

5572
```python
5673
from pusher import Pusher
57-
pusher = Pusher(app_id, key, secret, config=None, backend=None)
74+
pusher = Pusher(app_id, key, secret)
5875
```
5976

6077
|Argument |Description |
@@ -64,15 +81,15 @@ pusher = Pusher(app_id, key, secret, config=None, backend=None)
6481
|secret `String` |**Required** <br> The Pusher application secret token |
6582
|host `String` | **Default:`None`** <br> The host to connect to |
6683
|port `int` | **Default:`None`** <br>Which port to connect to |
67-
|ssl `bool` | **Default:`False`** <br> Use HTTPS |
84+
|ssl `bool` | **Default:`True`** <br> Use HTTPS |
6885
|cluster `String` | **Default:`None`** <br> Convention for other clusters than the main Pusher-one. Eg: 'eu' will resolve to the api-eu.pusherapp.com host |
69-
|backend `Object` | an object that responds to the send_request(request) method. If none is provided, a `python.sync.SynchronousBackend` instance is created. |
86+
|backend `Object` | an object that responds to the send_request(request) method. If none is provided, a `pusher.requests.RequestsBackend` instance is created. |
7087

7188
##### Example
7289

7390
```py
74-
from pusher import Pusher, Config
75-
pusher = Pusher(app_id=u'4', key=u'key', secret=u'secret', Config(ssl=True, cluster=u'eu'))
91+
from pusher import Pusher
92+
pusher = Pusher(app_id=u'4', key=u'key', secret=u'secret', ssl=True, cluster=u'eu')
7693
```
7794

7895
Triggering Events
@@ -267,6 +284,53 @@ webhook = pusher.validate_webhook(
267284
print webhook["events"]
268285
```
269286

287+
## Request Library Configuration
288+
289+
Users can configure the library to use different backends to send calls to our API. The HTTP libraries we support are:
290+
291+
* [Requests](http://docs.python-requests.org/en/latest/) (`pusher.requests.RequestsBackend`). This is used by default.
292+
* [Tornado](http://www.tornadoweb.org/en/stable/) (`pusher.tornado.TornadoBackend`).
293+
* [AsyncIO](http://asyncio.org/) (`pusher.aiohttp.AsyncIOBackend`).
294+
* [URLFetch](https://pypi.python.org/pypi/urlfetch) (`pusher.urlfetch.URLFetchBackend`).
295+
296+
Upon initializing a Pusher instance, pass in any of these options to the `backend` keyword argument.
297+
298+
### Google App Engine
299+
300+
GAE users are advised to use the URLFetch backend to ensure compatability.
301+
302+
## Feature Support
303+
304+
Feature | Supported
305+
-------------------------------------------| :-------:
306+
Trigger event on single channel | *&#10004;*
307+
Trigger event on multiple channels | *&#10004;*
308+
Excluding recipients from events | *&#10004;*
309+
Authenticating private channels | *&#10004;*
310+
Authenticating presence channels | *&#10004;*
311+
Get the list of channels in an application | *&#10004;*
312+
Get the state of a single channel | *&#10004;*
313+
Get a list of users in a presence channel | *&#10004;*
314+
WebHook validation | *&#10004;*
315+
Heroku add-on support | *&#10004;*
316+
Debugging & Logging | *&#10004;*
317+
Cluster configuration | *&#10004;*
318+
Timeouts | *&#10004;*
319+
HTTPS | *&#10004;*
320+
HTTP Proxy configuration | *&#10004;*
321+
HTTP KeepAlive | *&#10004;*
322+
323+
#### Helper Functionality
324+
325+
These are helpers that have been implemented to to ensure interactions with the HTTP API only occur if they will not be rejected e.g. [channel naming conventions](https://pusher.com/docs/client_api_guide/client_channels#naming-channels).
326+
327+
Helper Functionality | Supported
328+
-----------------------------------------| :-------:
329+
Channel name validation | &#10004;
330+
Limit to 10 channels per trigger | &#10004;
331+
Limit event name length to 200 chars | &#10004;
332+
333+
270334
Running the tests
271335
-----------------
272336

0 commit comments

Comments
 (0)