===================================================================
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")
Raw data
{
"_id": null,
"home_page": "https://github.com/youngsoul/PyParticleIO",
"name": "PyParticleIO",
"maintainer": "Patrick Ryan",
"docs_url": null,
"requires_python": "",
"maintainer_email": "pat_ryan_99@yahoo.com",
"keywords": "ParticleIO,Photon,Electron,Argon,Boron",
"author": "Patrick Ryan",
"author_email": "pat_ryan_99@yahoo.com",
"download_url": "https://files.pythonhosted.org/packages/8a/d1/02f2b316a784c32053cf2a540eaecb0cbfbe326e37aa9f91b879cee817f3/PyParticleIO-0.1.5.tar.gz",
"platform": null,
"description": "===================================================================\nPyParticleIO: Python package to interface with the ParticleIO cloud\n===================================================================\n\nPyPI Package to search for is: PyParticleIO\n===========================================\n\nInstall\n===========\n\n`pip install PyParticleIO`\n\n\n``PyParticleIO`` is an Open Source licensed Python package that provides a class to\ninterface with the ParticleIO cloud\n\nThis ParticleCloud class is meant to be a minimal python implementation\nto access a Particle devices (Core, Photon, Electron) functions, variables and events.\n\n::\n\n Inspired heavily from:\n\n https://github.com/Alidron/spyrk/blob/master/spyrk/spark_cloud.py\n\n -- Thank you for sharing your implementation\n\n\nCreate Instance of ParticleCloud\n================================\nparticle_cloud = ParticleCloud(access_token)\nparticle_cloud = ParticleCloud(username, password)\n\nList Devices\n============\nparticle_cloud.devices\n\nCall a function\n===============\nparticle_cloud.internet_button1.ledOn('led1')\n\nGet a variable value\n====================\nparticle_cloud.internet_button1.buttonCount\n\nSubscribe for a device specific event.\n======================================\ndef callback(event_data):\n print(\"event callback\")\n\nparticle_cloud.internet_button1.subscribe(\"button1\", callback)\n\nSubscribe for a non-device specific event\n=========================================\nparticle_cloud.internet_button1.cloud_subscribe(\"button2\", callback)\n\nPublish an event to the cloud\n=============================\nparticle_cloud.internet_button1.publish(\"do_rainbow\")\n\n\nTest Project\n------------\nAn example usage: ::\n\n from pyparticleio.ParticleCloud import ParticleCloud\n access_token = \"Your Access Token Here\"\n\n particle_cloud = ParticleCloud(username_or_access_token=access_token)\n\n all_devices = particle_cloud.devices\n for device in all_devices:\n print(\"Device: {0}\".format(device))\n\n print(\"done\")\n\n\nExample usage behind a proxy server: ::\n\n from pyparticleio.ParticleCloud import ParticleCloud\n access_token = \"Your Access Token Here\"\n proxy_dict = {\n \"proxies\": {\n \"https\": \"Your HTTPS Proxy Address Here\" # like \"https://192.168.1.1:8080\"\n }\n }\n\n particle_cloud = ParticleCloud(username_or_access_token=access_token, **proxy_dict)\n\n all_devices = particle_cloud.devices\n for device in all_devices:\n print(\"Device: {0}\".format(device))\n\n print(\"done\")\n",
"bugtrack_url": null,
"license": "Public Domain",
"summary": "Python module with a class to interface with the ParticleIO cloud",
"version": "0.1.5",
"split_keywords": [
"particleio",
"photon",
"electron",
"argon",
"boron"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8ad102f2b316a784c32053cf2a540eaecb0cbfbe326e37aa9f91b879cee817f3",
"md5": "003fa800aab55610bfa5e08c346d81ac",
"sha256": "f75c5a905f6f33d2227d097753f9233f34b7f0709cad99f035c26e060bb22800"
},
"downloads": -1,
"filename": "PyParticleIO-0.1.5.tar.gz",
"has_sig": false,
"md5_digest": "003fa800aab55610bfa5e08c346d81ac",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8062,
"upload_time": "2023-03-20T18:23:46",
"upload_time_iso_8601": "2023-03-20T18:23:46.529720Z",
"url": "https://files.pythonhosted.org/packages/8a/d1/02f2b316a784c32053cf2a540eaecb0cbfbe326e37aa9f91b879cee817f3/PyParticleIO-0.1.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-20 18:23:46",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "youngsoul",
"github_project": "PyParticleIO",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "bleach",
"specs": [
[
"==",
"5.0.1"
]
]
},
{
"name": "certifi",
"specs": [
[
"==",
"2022.9.24"
]
]
},
{
"name": "chardet",
"specs": [
[
"==",
"5.0.0"
]
]
},
{
"name": "charset-normalizer",
"specs": [
[
"==",
"2.1.1"
]
]
},
{
"name": "commonmark",
"specs": [
[
"==",
"0.9.1"
]
]
},
{
"name": "docutils",
"specs": [
[
"==",
"0.19"
]
]
},
{
"name": "hammock",
"specs": [
[
"==",
"0.2.4"
]
]
},
{
"name": "idna",
"specs": [
[
"==",
"2.6"
]
]
},
{
"name": "importlib-metadata",
"specs": [
[
"==",
"5.0.0"
]
]
},
{
"name": "jaraco.classes",
"specs": [
[
"==",
"3.2.3"
]
]
},
{
"name": "keyring",
"specs": [
[
"==",
"23.9.3"
]
]
},
{
"name": "more-itertools",
"specs": [
[
"==",
"8.14.0"
]
]
},
{
"name": "pkginfo",
"specs": [
[
"==",
"1.8.3"
]
]
},
{
"name": "Pygments",
"specs": [
[
"==",
"2.13.0"
]
]
},
{
"name": "python-dotenv",
"specs": [
[
"==",
"0.21.0"
]
]
},
{
"name": "readme-renderer",
"specs": [
[
"==",
"37.2"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.28.1"
]
]
},
{
"name": "requests-toolbelt",
"specs": [
[
"==",
"0.10.0"
]
]
},
{
"name": "rfc3986",
"specs": [
[
"==",
"2.0.0"
]
]
},
{
"name": "rich",
"specs": [
[
"==",
"12.6.0"
]
]
},
{
"name": "six",
"specs": [
[
"==",
"1.16.0"
]
]
},
{
"name": "sseclient",
"specs": [
[
"==",
"0.0.27"
]
]
},
{
"name": "twine",
"specs": [
[
"==",
"4.0.1"
]
]
},
{
"name": "urllib3",
"specs": [
[
"==",
"1.26.12"
]
]
},
{
"name": "webencodings",
"specs": [
[
"==",
"0.5.1"
]
]
},
{
"name": "zipp",
"specs": [
[
"==",
"3.9.0"
]
]
}
],
"lcname": "pyparticleio"
}