PyParticleIO: Python package to interface with the ParticleIO cloud
PyPI Package to search for is: PyParticleIO
Install
pip install 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")
Metadata
Release files for pyparticleio 0.1.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyparticleio-0.1.11.tar.gz | 8.2 kB | Without provenance | Details for pyparticleio-0.1.11.tar.gz |
Release files / pyparticleio-0.1.11.tar.gz
| Download URL | pyparticleio-0.1.11.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dd7f61f8b94c0d5404acbf0595bc149952e6912a9247d6cf697b945e27a8e35a
|
|
BLAKE2b-256 checksum How to use checksums |
8215107d01d7d54692f0f590fd4afb14b5a7242fe27db438959a3a48004c5c88
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.3
|
Security for pyparticleio 0.1.11
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.