GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - kmaehashi/sensorbee-python: :honeybee: SensorBee REST / WebSocket Client API for Python :snake:

BranchesTags
Open more actions menu

Latest commit

 

History

73 Commits
73 Commits

Folders and files

NameName
Last commit message
Last commit date
example
example
 
 
pysensorbee
pysensorbee
 
 
.coveragerc
.coveragerc
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
ChangeLog.rst
ChangeLog.rst
 
 
LICENSE
LICENSE
 
 
README.rst
README.rst
 
 
codecov.yml
codecov.yml
 
 
setup.py
setup.py
 
 
tox.ini
tox.ini
 
 

Repository files navigation

Travis Coveralls PyPi

sensorbee-python

This is a Python client library for SensorBee REST / WebSocket API. This library also provides utility commands (sbstat and sbpeek) which can be used to inspect SensorBee topology.

Install

pip install sensorbee-python

To use WebSocket Client API, you also need to install websocket-client:

pip install websocket-client

Requirements

  • Python 2.7, 3.3, 3.4, 3.5 or 3.6.

Usage

Python API

In most cases the only class you need to use is pysensorbee.api.SensorBeeAPI. Here is an example:

from pysensorbee import SensorBeeAPI

api = SensorBeeAPI('127.0.0.1', 15601)
api.create_topology('test')
api.query('test', 'CREATE SOURCE ns TYPE node_statuses;')
for r in api.query('test', 'SELECT RSTREAM * FROM ns [RANGE 1 TUPLES];'):
  print(r)

See pydoc pysensorbee.api for details.

Commands

sbstat provides a brief summary of the topology status.

$ sbstat -H 127.0.0.1 -P 15601 -t test
   Node                          Status    Received   Error   Output                            Sent     Queued   Dropped
-> node_stats                    running                      (total)                           5381                    0
                                                                  sensorbee_tmp_8               5381   0 (0.0%)
:: sensorbee_tmp_8               running       5381       0   (total)                           5381                    0
                                                                  sensorbee_tmp_select_sink_7   5381   0 (0.0%)
<- sensorbee_tmp_select_sink_7   running       5381       0

Sources, streams and sinks are indicated by ->, :: and <-, respectively.

sbpeek can be used to peek what tuple is currently running through the specified source or stream.

$ sbpeek -H 127.0.0.1 -P 15601 -t test -1 node_stats
{"behaviors": {"remove_on_stop": false, "stop_on_disconnect": false}, "node_type": "source", "output_stats": {"num_sent_total": 5893, "outputs": {"sensorbee_tmp_58": {"queue_size": 1024, "num_sent": 0, "num_queued": 0}, "sensorbee_tmp_8": {"queue_size": 1024, "num_sent": 5893, "num_queued": 0}}, "num_dropped": 0}, "state": "running", "node_name": "node_stats"}

See sbstat --help and sbpeek --help for details.

Notice

  • This library is not a part of the official SensorBee project.
  • In addition to APIs documented in the API Specification Version 1, this library supports some undocumented APIs, including WebSocket API.
  • This project is a successor of beepy.

License

MIT License

About

🐝 SensorBee REST / WebSocket Client API for Python 🐍

Topics

pythonpython3sensorbee

Resources

Readme
MIT license
Activity

Stars

3 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.