snsary

A framework for sensor metrics


License
MIT
Install
pip install snsary==0.1.1

Documentation

Snsary

A framework for sensor metrics.

Installation

pip3 install snsary

Getting started

Create a new file called example.py and paste:

from snsary import system
from snsary.outputs import MockOutput
from snsary.sources import MockSensor
from snsary.utils import logging

MockSensor().subscribe(MockOutput())
logging.configure_logging()
system.start_and_wait()

This is a minimal Snsary program. To run it:

python3 example.py

At this point you should see some INFO logs e.g.

2021-11-13 19:07:17,144 - INFO - [mocksensor-4382645216] Collected 1 readings.
2021-11-13 19:07:17,144 - INFO - [mockoutput-4383959840] Reading: <zero 1636830437 0>

Use Ctrl+C to quit the program.

Building an app

Snsary makes it easy to build large sensing apps:

docs/examples/contrib.py shows many of them working together.

How to deploy it

See the tutorial for how to setup and run a Snsary app as a service on a Raspberry Pi.

Contributing

See CONTRIBUTING.md.

Licence

See LICENCE.