Skip to main content

Toolbox for accessing ASAM ODS servers using the HTTP API

Project description

ASAM ODSBox

PyPI Version Python Versions License

The ODSBox is a lightweight Python wrapper on the standardized ASAM ODS REST API. It simplifies the handling of ASAM ODS data in Python by utilizing intuitive JAQuel queries and pandas DataFrames.

Features

  • Lightweight Python wrapper for the ASAM ODS HTTP API.
  • Intuitive querying using JAQuel Query Language.
  • Seamless integration with pandas DataFrames for data analysis.
  • Includes generated ASAM ODS protobuf stubs.
  • Supports authentication mechanisms via requests.
  • Bulk helper for quantity data access as pandas DataFrames.

Quick Start

  1. Install ODSBox: pip install odsbox
  2. Connect to an ASAM ODS server:
    from odsbox import ConI
    
    with ConI(url="https://MY_SERVER/api", auth=("USERNAME", "PASSWORD")) as con_i:
        measurements = con_i.query(
            {
                "AoMeasurement": {"name": {"$like": "*"}},
                "$attributes": {"name": 1, "id": 1},
                "$options": {"$rowlimit": 50},
            }
        )
        print(measurements) # print pandas DataFrame with column "name" and "id"
    

Documentation

Communication

The ASAM ODS server communicates via HTTP calls as specified in the ASAM ODS standard, which defines a RESTful API for accessing and manipulating measurement data. This allows for standardized interactions, including operations like querying, creating, updating, and deleting entities such as measurements, tests, and results.

Data exchanged between the client (e.g., ODSBox) and the server is encoded and decoded using Protocol Buffers (protobuf), a binary serialization format developed by Google. Protobuf ensures efficient, compact, and fast data transfer compared to text-based formats like JSON, making it ideal for handling large datasets in technical measurement scenarios. The official protobuf message definitions are available in the ASAM-ODS-Interfaces repository.

Requests use the custom content type application/x-asamods+protobuf to indicate protobuf-encoded payloads. ODSBox abstracts these low-level details, allowing developers to interact with the API using intuitive Python dictionaries and methods, while handling authentication (e.g., via username/password or tokens) and connection management seamlessly.

JAQuel Queries

JAQuel enables intuitive data querying, drawing inspiration from the MongoDB Query Language (MQL). Its JSON-based query expressions seamlessly integrate with Python as dictionaries, offering a powerful and user-friendly approach to data retrieval.

Installation

ODSBox is available on PyPI and GitHub.

github https://github.com/peak-solution/odsbox/
PyPI https://pypi.org/project/odsbox/
github docs https://peak-solution.github.io/odsbox
# access ASAM ODS server
pip install odsbox
# access ASAM ODS EXD-API plugin
pip install odsbox[exd-data]

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

License

This project is licensed under the MIT License.

Project details


Release history Release notifications | RSS feed

This version

1.3.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

odsbox-1.3.0.tar.gz (58.5 kB view details)

Uploaded Source

Built Distribution

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

odsbox-1.3.0-py3-none-any.whl (67.8 kB view details)

Uploaded Python 3

File details

Details for the file odsbox-1.3.0.tar.gz.

File metadata

  • Download URL: odsbox-1.3.0.tar.gz
  • Upload date:
  • Size: 58.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.9 {"installer":{"name":"uv","version":"0.11.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for odsbox-1.3.0.tar.gz
Algorithm Hash digest
SHA256 38e3d4d2b6ae6fb97c785873567acf72709b93dab7df56e469b2faa4915cc8cb
MD5 48c8f7977760d094dc82eadffa539306
BLAKE2b-256 fea5e9c3f41a6f6ba891b9b153f20fd45f243284b6e20225e407589cb4949076

See more details on using hashes here.

File details

Details for the file odsbox-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: odsbox-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 67.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.9 {"installer":{"name":"uv","version":"0.11.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for odsbox-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 24093295a006862600b83dcfe1c44ecb9d4832dcc4af2822c7334572de101c3e
MD5 2a68759d5ad6ada88dafa675c6b02aaf
BLAKE2b-256 2e64eedb386f8242e8429735c8156a7bfb4b098fc8836cd86d76eb34215f27d2

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