diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 102 | 
1 files changed, 22 insertions, 80 deletions
| @@ -1,100 +1,42 @@ -## PubNub 3.3 Web Data Push Cloud-hosted API - PYTHON -#### www.pubnub.com - PubNub Web Data Push Service in the Cloud.  -#### http://github.com/pubnub/python +## Contact support@pubnub.com for all questions -## Major Upgrade to 3.6 underway! In the meantime, we've provided Python 3 beta support in the python3 branch. - -Contact us at support@pubnub.com if you have any questions in the meantime. - -#### Init +#### [PubNub](http://www.pubnub.com) Real-time Data Network +##### Clients for Python, including Twisted and Tornado +## Installation  ``` -pubnub = Pubnub( -    "demo",  ## PUBLISH_KEY -    "demo",  ## SUBSCRIBE_KEY -    None,    ## SECRET_KEY -    False    ## SSL_ON? -) +pip install pubnub==3.5.0  ``` +Examples and instructions for the SDK are available in their acompanying README.md, migration.md and examples directories under their specific platform directories: -#### PUBLISH - -``` -info = pubnub.publish({ -    'channel' : 'hello_world', -    'message' : { -        'some_text' : 'Hello my World' -    } -}) -print(info) -``` - - -#### SUBSCRIBE - -``` -# Listen for Messages *BLOCKING* -def receive(message) : -    print(message) -    return True +[Standalone Python - Everyday python for your scripts and apps](python) -pubnub.subscribe({ -    'channel'  : 'hello_world', -    'callback' : receive  -}) -``` +[Tornado - For use with the Python Tornado Framework](python-tornado) +[Twisted - For use with the Python Twisted Framework](python-twisted) -#### PRESENCE +## Migration and Reversion +If you need to revert to the previous version of PubNub, run this commandline:  ``` -# Listen for Presence Event Messages *BLOCKING* - -def pres_event(message) : -    print(message) -    return True - -pubnub.presence({ -    'channel'  : 'hello_world', -    'callback' : receive  -}) +pip install pubnub==3.3.5  ``` -#### HERE_NOW +Migration information for the SDK are available in their migration.md under their specific platform directories: -``` -# Get info on who is here right now! +Migration docs for Python Standalone are [found here.](python/migration.md) -here_now = pubnub.here_now({ -    'channel' : 'hello_world', -}) +Migration docs for Tornado are [found here.](python-tornado/migration.md) -print(here_now['occupancy']) -print(here_now['uuids']) -``` +Migration docs for Twisted [found here.](python-twisted/migration.md) -#### Channel Analytics +## Pubnub Console +Pubnub console is a command line app which allows you to do various  +pubnub operations like publish, subscribe, getting history, here now, +presence etc from command line  ``` -analytics = pubnub.analytics({ -    'channel'  : 'channel-name-here', ## Leave blank for all channels -    'limit'    : 100,                 ## aggregation range -    'ago'      : 0,                   ## minutes ago to look backward -    'duration' : 100                  ## minutes offset -}) -print(analytics) - +pip install pubnub-console  ``` -#### HISTORY - -``` -# Load Previously Published Messages -history = pubnub.detailedHistory({ -    'channel'   : 'my_channel', -    'end'       : my_end_time_token, # Optional -    'start'     : my_start_time_token, # Optional -    'count'     : num_of_msgs_to_return # Optional, default is 100 -}) -print(history) -``` +## Contact support@pubnub.com for all questions | 
