Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Python module with a class to interface with the ParticleIO cloud

Project Description

PyPI Package to search for is: PyParticleIO

PyParticleIO is an Open Source licensed Python package that provides a class to interface with the ParticleIO cloud

This ParticleCloud class is meant to be a minimal python implementation to access a Particle devices (Core, Photon, Electron) functions, variables and events.

Inspired heavily from:

https://github.com/Alidron/spyrk/blob/master/spyrk/spark_cloud.py

-- Thank you for sharing your implementation

Create Instance of ParticleCloud

particle_cloud = ParticleCloud(access_token) particle_cloud = ParticleCloud(username, password)

List Devices

particle_cloud.devices

Call a function

particle_cloud.internet_button1.ledOn(‘led1’)

Get a variable value

particle_cloud.internet_button1.buttonCount

Subscribe for a device specific event.

def callback(event_data):
print(“event callback”)

particle_cloud.internet_button1.subscribe(“button1”, callback)

Subscribe for a non-device specific event

particle_cloud.internet_button1.cloud_subscribe(“button2”, callback)

Publish an event to the cloud

particle_cloud.internet_button1.publish(“do_rainbow”)

Test Project

An example usage:

from pyparticleio.ParticleCloud import ParticleCloud
access_token = "Your Access Token Here"

particle_cloud = ParticleCloud(username_or_access_token=access_token)

all_devices = particle_cloud.devices
for device in all_devices:
    print("Device: {0}".format(device))

print("done")

Example usage behind a proxy server:

from pyparticleio.ParticleCloud import ParticleCloud
access_token = "Your Access Token Here"
proxy_dict = {
    "proxies": {
        "https": "Your HTTPS Proxy Address Here"  # like "https://192.168.1.1:8080"
    }
}

particle_cloud = ParticleCloud(username_or_access_token=access_token, **proxy_dict)

all_devices = particle_cloud.devices
for device in all_devices:
    print("Device: {0}".format(device))

print("done")
Release History

Release History

This version
History Node

0.0.9

History Node

0.0.8

History Node

0.0.7

History Node

0.0.6

History Node

0.0.5

History Node

0.0.4

History Node

0.0.3

History Node

0.0.2

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
PyParticleIO-0.0.9.tar.gz (6.7 kB) Copy SHA256 Checksum SHA256 Source Nov 13, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting