Skip to main content

PyClient

Python Client for retrieving Bioto sensor data

Goals

Session management

  • create session via device login to get a valid access token

Retrieving sensor data

  • find a garden
  • subscribe to that garden
  • see subscribtion state for that garden (pending/approved/declined)
  • get an overview of your gardens
  • retrieve sensor data from garden devices

Getting started

There are two ways of installing this client. The first one using pip:

% pip install --user bioto-client

The second option is useful when developing the client. Git clone the project and use make for installation. This will setup a virtual python environment managed via poetry.

% make install
% poetry shell

How to use

Tip Use bioto-client --help to see other available commands

Start a user session

A user session is valid for 24h. When expired you're requested to create a new session. This can be done as follows:

# Call the client with the `user` command to assert a valid session
% bioto-client user

Loading session

Not logged in, please take the following steps:

1. On your computer or mobile device navigate to: https://biotoco.eu.auth0.com/activate?user_code=NEWT-OKEN
2. Enter the following code:  NEWT-OKEN

Succesfully logged in.

Bioto CLI client: 1.2.3
Environment: prod
Session token ***5OFd09w

Find a garden

Gardens can be found by name, the command to do this is:

% bioto-client search-garden {name}

Subscribe to a garden

To gain access to the data of this garden you need to subscribe to this garden using its ID:

% bioto-client subscribe-garden {garden_id}

This will create a subscription request which only the mainter(s) can approve. To check the state of your subscription see:

% bioto-client subscriptions

Read device data

Reading a device is done by device ID, these can be found via the garden command. Note that a garden might contain multiple devices.

To get the latest hourly readings for the last 24h issue the following command:

% bioto-client device {device_id}

To get these readings for a sepecific date apply a date option. The following formats are allowed: [%Y-%m-%d | %Y-%m-%dT%H:%M:%S | %H:%M:%S]:

% bioto-client device {device_id} --date={date}

And to limit or increase the number of hours returned add the hours option:

% bioto-client device {device_id} --hours={hours_limit}

Improve the client

If you want to improve the client or add something which you think is missing to the project you can either open an issue or develop the feature yourself and open a pull request with your changes.

To get started clone this project and create a branch. Now fix the bug or create the feature you want and write some tests for it to prove it works. This can be done by executing:

% make check

Note This will run both tests and linters, use make test when you're in red - green - refactor mode

When the checks are all passing, please open a PR

Release files for bioto-client 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bioto-client 0.1.7
File Size Uploaded
bioto_client-0.1.7.tar.gz 9.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bioto-client 0.1.7
File Interpreter ABI Platform
bioto_client-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size:21.6 kB

Release files / bioto_client-0.1.7.tar.gz

Download URL bioto_client-0.1.7.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d99a1454f5f9782c5fdcdda87a22488d4ac4d2c7a8eff2396975f0bb2afe58b4
BLAKE2b-256 checksum
How to use checksums
955b3f27518db5d0aba27907cd16a27704888afa2c4ee4ee79c28fec7889f310
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.10.9 Darwin/22.3.0

Release files / bioto_client-0.1.7-py3-none-any.whl

Download URL bioto_client-0.1.7-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
18e7fb3ac8f829ba36b1e9e7dade47119b1455505741c696cc73dbf1c9908344
BLAKE2b-256 checksum
How to use checksums
9bd8727a505ea07643ce3ef54b151d18a9eb1121f78edb8653d6f66305a6ef1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.10.9 Darwin/22.3.0

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page