Skip to main content

REST API library for pushbots.

Project description

A python 2/python 3 REST API library module (wrapper) for pushbots. The module, the tests and the examples work for both python 2 and python 3 versions.
Current “pushbots” module supports all of the pushbots API calls. List of supported API calls follow:
  • Register (For testing API call)

  • Register Batch (For testing API call)

  • unRegister (For testing API call)

  • Alias

  • Tag

  • unTag

  • Device Location (For testing API call)

  • Devices Info

  • Device Info (For testing API call)

  • Push (For testing API call)

  • Push Batch

  • Get Push analytics

  • Record Analytics

In the list above, some of the API calls are tagged with “(For testing API call)”. This means that a token is needed to perform those API calls and since this module is reserved for backends, you, normally, won’t be using those API calls. Though you can retrieve device tokens based on alias, tags, etc through devices info (see examples/get_token_from_alias.py and examples/location.py, examples/unregister.py for more info):

There is also a second list of generic API calls, for calls not listed in the first list. At the moment of creating this all API calls are supported. This is provided for future API calls:

  • Put (For generic put API calls, not listed above)

  • Post (For generic post API calls, not listed above)

  • Get (For generic get API calls, not listed above)

Install

You can choose to install “pushbots”. If you don’t want to install it, you can manually copy the “pushbots” package into your project. There are two ways to install “pushbots”.

  • With pip: pip install pushbots

  • Manually: Go to releases and download the latest version. Extract the compressed file, navigate to project’s root directory and run: python setup.py install

Dependencies

For “pushbots” to work, python “requests” must be installed. If you already have “setuptools” installed and choose to install “pushbots” from pip or setup.py, you don’t have to manually install “requests”. On any other case, you must install it manually:
pip install requests

How to use

from pushbots import Pushbots
# Your code

Examples

You can find examples under pushbots/examples directory. If there is an API call missing from the first list mentioned above, you can view the examples/generic.py examples, on how to make custom API calls, listed in the second list mentioned (put, post, get). If you want to perform token operations, you can use the examples/get_token_from_alias.py to get the devices tokens and platforms associated with a specific alias. Also the files, examples/location.py and examples/unregister.py make use of tokens to make an API call, whereas all the other files in examples make use of alias, tags etc for the API calls.

Tests

The tests package is located under pushbots directory. Tests create virtual devices to test the API calls provided by “pushbots” module. You can run the tests by typing:

python -m pushbots.tests.run

If you want help on how to run tests, type:

python -m pushbots.tests.run -h

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pushbots-0.0.2.tar.gz (13.5 kB view details)

Uploaded Source

File details

Details for the file pushbots-0.0.2.tar.gz.

File metadata

  • Download URL: pushbots-0.0.2.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pushbots-0.0.2.tar.gz
Algorithm Hash digest
SHA256 7c18d5ddb996c9475cdb5c5835c46052beae45245f74e92157458198b4211220
MD5 5d72e139fd8da3497df8852e26f46fdd
BLAKE2b-256 87117c3aec81f0217d07cd639b51156da5ab5fbcc532e9105b5d8fc29548bee5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page