Skip to main content

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

Installation

Clone the repository and install in editable mode:

git clone https://github.com/your_username/pyomnisense.git
cd pyomnisense
pip install -e .

Usage

from pyomnisense.omnisense import Omnisense

async def main():
    omnisense = Omnisense()
    # Login with your credentials
    await omnisense.login("your_username", "your_password")
    
    # Get list of sites
    sites = await omnisense.get_site_list()
    print("Available sites:", sites)

    #get list of all sensors from the first site
    site_id = list(sites.keys())[0]

    sensor_result = await omnisense.get_sensor_data(site_id)

    print("Sensor Data for Site:", sensor_result)
    
    # When done, close the session
    await omnisense.close()

# Run the async main function using an event loop (e.g., in asyncio)
import asyncio
asyncio.run(main())

Replace "your_username" and "your_password" with your actual Omnisense credentials. For more details, refer to the documentation or explore the source code.

Testing

Tests are written using pytest and pytest-asyncio. You can run tests as follows:

pytest

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

pyomnisense-0.1.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyomnisense-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file pyomnisense-0.1.0.tar.gz.

File metadata

  • Download URL: pyomnisense-0.1.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for pyomnisense-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4102a62e68cb0c5a0106b4e73032bc0e20457f544b7ff3fc349d10af562d0db8
MD5 6352523c0d54ffa2d2410e0d79a4b7c3
BLAKE2b-256 f08a15f22a58867b08e71530c06ab42bda67665e2abd1cc5c666b75962ffe68e

See more details on using hashes here.

File details

Details for the file pyomnisense-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyomnisense-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for pyomnisense-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5b6de8ffc6619c9f755ef79b58e09a6ad309f5ce4c923a84a767cbc62b86c04f
MD5 948ffacdb951b398648e297b8b662e42
BLAKE2b-256 26dba2c5acb741ce5e5beb65082143fefa7cd09b6421687dc90d7cfa761a642f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page