Skip to main content

Sensoterra

Package to retrieve Sensoterra probe data by polling the Sensoterra Customer API using async/await.

Example code

When the email and password are always available:

import time
import asyncio

from sensoterra.customerapi import CustomerApi

async def main(email, password):
  api = CustomerApi(email, password)
  api.set_language("en")

  while True:
    api.poll()

    for probe in api.probes():
        print(probe)
        for sensor in probe.sensors():
            print(sensor)
        print()

    time.sleep(900)
    print('-' * 70)

asyncio.run(main("me@example.com", "secret"))

Otherwise request a authentication token:

from datetime import datetime

async def get_token(email, password):
  api = CustomerApi(email, password)
  api.set_language("en")

  tag = "My Application"
  scope = "READONLY"
  expiration = datetime(2038, 1, 1, 0, 0)
  token = await api.get_token(tag, scope, expiration)

And use this token:

async def main(email, password):
  token = await get_token(email, password)

  api = CustomerApi()
  api.set_language("en")
  api.set_token(token)

  while True:
    probes = await api.poll()

    for probe in probes:
        print(probe)
        for sensor in probe.sensors():
            print(sensor)
        print()

    time.sleep(900)
    print('-' * 70)

Changelog

CHANGELOG

Release files for sensoterra 2.0.1

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

Source distribution (sdist)

Source distribution for sensoterra 2.0.1
File Size Uploaded
sensoterra-2.0.1.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sensoterra 2.0.1
File Interpreter ABI Platform
sensoterra-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.5 kB

Release files / sensoterra-2.0.1.tar.gz

Download URL sensoterra-2.0.1.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
59f8d33a7b3938f53cfae7c37857431a351184159415fc3fa9148741acc12f4e
BLAKE2b-256 checksum
How to use checksums
7b86a62eb7206173faca0974dc1f195b2400b49b5d0f0bf4141541c8b4189086
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.8

Release files / sensoterra-2.0.1-py3-none-any.whl

Download URL sensoterra-2.0.1-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b25e6a9276e1f7e71efeed41c91e326e832bb021b5d2c0532fee6dbda5c73120
BLAKE2b-256 checksum
How to use checksums
340df3b2c3af973860ad0bcb74040dde8e7e38e8740c7ecba7e7f2c462ca14f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.8

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files

2.0.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.3.0

2 release files

0.1.1

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