I've created a very simple Python library for use with the PushingBox Notification API and I just thought I would share the love with the community in case its useful for anyone else out there.
The library can be found on GitHub here: https://github.com/jazzycamel/pushingbox
The README on the github pretty much explains it all, but I'll reproduce it here for ease.
The library is simply installed through pip and, seeing as its pure Python, should be useable anywhere Python can be installed including useful IoT type platforms such as the Raspberry Pi. Installation is as simple as:
$ pip install PushingBox
As to usage, this is extremely simple. First create a 'Scenario' via the PushingBox dashboard. This will generate a DeviceID for your scenario, for example: v0123456789ABCDE
. To use this scenario with this python library is as easy as the following:
>>> from PushingBox import PushingBox
>>> pbox=PushingBox()
>>> pbox.push('v0123456789ABCDE')
If your Scenario contains variables, as per the following example from the PushingBox API page:
The $room$ temperature is $temperature$ degrees
Then you can pass these variables as keyword arguments to the push()
method as follows:
>>> pbox.push('v0123456789ABCDE', room='kitchen', temperature='23')
Its as simple as that. I hope this is useful to somebody else, all comments and suggestions gratefully received.
Comments