Skip to main content

Python module to push data to the Pervasive Nation IoT network. It saves data locally until there is internet access.

Project description

# pndatapush Python module to push data to the Pervasive Nation IoT network. It saves data locally until there is internet access.

#To install

`python pip install --upgrade pndatapush `

#To run an example

`python python examples/gatherdata.py `

# Easiest way to add to your project Create an instance of the Offline class.

`python from pndatapush.offline import Offline from pndatapush.pushdata import PNPushData #Set the PervasiveNation Auth token pnpushdata = PNPushData(pervasivenation_authtoken="MYREALLYLONGTOKENIGOTSECRET") offline = Offline(payload_consumers=[pnpushdata]) `

## OR if you want to use environment variables:

` #set your PervasiveNation Auth token by using an environment variable before starting your applicaiton export PERVASIVENATION_AUTHTOKEN="MYREALLYLONGTOKENIGOTSECRET" `

`python from pndatapush.offline import Offline from pndatapush.pushdata import PNPushData offline = Offline(payload_consumers=[PNPushData]) #PNPushData is a data consumer class. see pnpushdata.pushdata.PNPushData `

## AND if you want the local database in your current directory:

`python import os from pndatapush.offline import Offline from pndatapush.pushdata import PNPushData #Set the PervasiveNation Auth token pnpushdata = PNPushData(pervasivenation_authtoken="MYREALLYLONGTOKENIGOTSECRET") #Set the local SQLite DB path offline = Offline(payload_consumers=[pnpushdata], dbpath='sqlite:///%s/sensordata.db' % os.path.dirname(os.path.realpath(__file__))) `

Then when sensor data is received save the data

`python device_identifier = '12456' offline.save(device_identifier, 30.00) #save(self, deviceid, payload): `

Changelog

0.0.1 (2016-04-13)

  • First release on PyPI.

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

pndatapush-0.0.2.tar.gz (9.4 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for pndatapush-0.0.2.tar.gz
Algorithm Hash digest
SHA256 43a5d99b11e6aa6b766c3c566b798cbebba85bf7da4ff4a2010d1253c4df9acf
MD5 18c8057def9b52204ff1e521f94e37cd
BLAKE2b-256 6c0fd6a1fba48c88d47690e03f3d5ffb322f03287d878b8c03414fd44c55b1bf

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