Python HTTP Robotice Client
Project description
Python client for https://github.com/robotice/robotice-control and https://github.com/robotice/robotice
Installation
pip install python-roboticeclient
roboticeclient
DEBUG (client) GET - http://127.0.0.1:8004/device - {}
INFO (connectionpool) Starting new HTTP connection (1): 127.0.0.1
DEBUG (connectionpool) "GET /device HTTP/1.1" 200 839
{u'control-single.robotice.dev.mjk.robotice.cz': {u'actuators': {u'dummy1': {u'device': u'dummy', u'metric': u'random', u'type': u'dummy', u'port': u'bcm18'}}, u'sensors': {u'dummy1': {u'device': u'dummy', u'metric': u'random', u'type': u'dummy', u'port': u'bcm18'}, u'hygro_case1_do':
roboticeclient -h
usage: robotice [-t TYPE] [--host HOST] [-p PORT] [-a ACTION] [-c COLLECTION]
[--version] [-d] [-v]
Optional arguments:
-t TYPE, --type TYPE type robotice or control
--host HOST host
-p PORT, --port PORT port
-a ACTION, --action ACTION
list, get, create, update
-c COLLECTION, --collection COLLECTION
collection
Usage as Robotice Client
from roboticeclient import Client
# listings
client = Client(port=8004, host="127.0.0.1")
print client.devices.list()
print client.plans.list()
print client.systems.list()
print client.actions.list()
client.actions.save(id, action)
Usage as Robotice Control Client !
from roboticeclient import Client
# listings
client = Client(type="control", port=9753, host="127.0.0.1")
print client.devices.list()
print client.plans.list()
print client.systems.list()
print client.actions.list()
client.actions.save(id, action)
Advance usage with Django or Openstack Horizon Dashboard !
# local_settings.py
ROBOTICE_HOST default is localhost
ROBOTICE_PORT default is 9753
ROBOTICE_PROTOCOL default is http
from roboticeclient.common.horizon import HorizonClient
from roboticeclient.common.horizon import DjangoClient
from roboticeclient.control.v1.base import RoboticeControlClient
RoboticeControlClient.client_class = HorizonClient # or plain DjangoClient
robotice_client = RoboticeControlClient(type="control")
robotice_client.devices.list()
Read more
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file python-roboticeclient-0.0.2.tar.gz
.
File metadata
- Download URL: python-roboticeclient-0.0.2.tar.gz
- Upload date:
- Size: 27.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cdc5fe160cd814f6bb7f663459464b09802b67f9faa2b174c3f4a7350dbb499 |
|
MD5 | fef95ccaa0f899d4de8f2f119de729a5 |
|
BLAKE2b-256 | 3720dfd4ead93ec099fd2997ca47c8b030f130cf055239ca16d472ad211ee80c |