Toolbox for accessing ASAM ODS servers using the HTTP API
Project description
ASAM ODSBox
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
- Install ODSBox:
pip install odsbox - 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
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 odsbox-1.2.0rc545.post1.tar.gz.
File metadata
- Download URL: odsbox-1.2.0rc545.post1.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.33.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e68721be9b0e0daf71addd462bdf643459a3f9d379c61544b873c02e8eb4c395
|
|
| MD5 |
0ae7c823f0ee95e12d0eedfa0d082365
|
|
| BLAKE2b-256 |
7c317c92275d118c4dd38e848dbf1fcd89b0a75ed47a74b2a894913bd6bdb489
|
File details
Details for the file odsbox-1.2.0rc545.post1-py3-none-any.whl.
File metadata
- Download URL: odsbox-1.2.0rc545.post1-py3-none-any.whl
- Upload date:
- Size: 68.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.33.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c551712a88f9803cdda09cd1b0ad9f6af2be4f73d1413afe6c702617f111159
|
|
| MD5 |
abe682c8cb13174d5b6353fa25b3b193
|
|
| BLAKE2b-256 |
1c492aff76779fce22414a068a6c142be8d24b542c72781a3069fad7cc8efb88
|