Python library for accessing Omnisense sensor data from omnisense.com
Project description
pyomnisense
pyomnisense is a Python library for accessing Omnisense sensor data directly from the omnisense.com website. It supports logging into the service, retrieving site lists, and fetching sensor data.
Features
- Login to the Omnisense website
- Retrieve a list of sites with sensor data
- Fetch detailed sensor data for a selected site
- Asynchronous methods using aiohttp
- Transparent re-login if the server expires the session between calls
Install this repo
Clone the repository and install in editable mode:
git clone https://github.com/sslivins/pyomnisense.git
cd pyomnisense
pip install -e .
Install from pypi.org
pip install pyomnisense
Usage
import asyncio
from pyomnisense import Omnisense, OmnisenseAuthError
async def main():
async with Omnisense() as omnisense:
try:
await omnisense.login("your_username", "your_password")
except OmnisenseAuthError as err:
print(f"Login failed: {err}")
return
sites = await omnisense.get_site_list()
print("Available sites:", sites)
sensor_data = await omnisense.get_sensor_data(sites)
print("Sensor data:", sensor_data)
asyncio.run(main())
Replace "your_username" and "your_password" with your actual Omnisense credentials. The async with block guarantees the underlying HTTP session is closed even on errors.
Testing
Tests are written using pytest and pytest-asyncio. You can run tests as follows:
pytest -m offline
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyomnisense-0.2.0.tar.gz.
File metadata
- Download URL: pyomnisense-0.2.0.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8b8ccdd31b7e05e79a519f61013a34e9377aa9bad8744c7cd7a3df321332bfb
|
|
| MD5 |
165b690eb5d5202df52f5dffed21da88
|
|
| BLAKE2b-256 |
a6d0df09c9ebe35edb15e7f33996c26976a24f6566f770fbb8f3ae0ac07fa61a
|
Provenance
The following attestation bundles were made for pyomnisense-0.2.0.tar.gz:
Publisher:
publish_to_pypi.yml on sslivins/pyomnisense
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyomnisense-0.2.0.tar.gz -
Subject digest:
d8b8ccdd31b7e05e79a519f61013a34e9377aa9bad8744c7cd7a3df321332bfb - Sigstore transparency entry: 1549569467
- Sigstore integration time:
-
Permalink:
sslivins/pyomnisense@bf2cd69a7aa3da8393e2bca2b79d04ca559e3205 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/sslivins
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_to_pypi.yml@bf2cd69a7aa3da8393e2bca2b79d04ca559e3205 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyomnisense-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pyomnisense-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9f07452dbdf83e2edef7dcd1e9466041e26348179cd93f5b8d2a0b25dcff49c
|
|
| MD5 |
e04c5eece18123723f69c57dabd60a97
|
|
| BLAKE2b-256 |
0332e97790ea32dee157bf428b904990f38d2e6be7191f899b50b6545928cedf
|
Provenance
The following attestation bundles were made for pyomnisense-0.2.0-py3-none-any.whl:
Publisher:
publish_to_pypi.yml on sslivins/pyomnisense
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyomnisense-0.2.0-py3-none-any.whl -
Subject digest:
f9f07452dbdf83e2edef7dcd1e9466041e26348179cd93f5b8d2a0b25dcff49c - Sigstore transparency entry: 1549569505
- Sigstore integration time:
-
Permalink:
sslivins/pyomnisense@bf2cd69a7aa3da8393e2bca2b79d04ca559e3205 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/sslivins
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_to_pypi.yml@bf2cd69a7aa3da8393e2bca2b79d04ca559e3205 -
Trigger Event:
push
-
Statement type: