Helper package to build ASAM ODS EXD API grpc plugins.
Project description
ASAM ODS EXD-API for NI TDMS Files
ASAM ODS EXD-API Architecture
sequenceDiagram
actor CLIENT as Client
participant PDTT as 🛠️Importer
participant PODS as 🗃️ASAM ODS server
participant PLUGIN as 📊EXD-API plugin
participant FILE as 🗂️File Storage
autonumber
opt Import phase
FILE ->>+ PDTT: New file shows up
PDTT ->>+ PLUGIN : Get Structure
PLUGIN -> FILE: Extract content information
PLUGIN ->> PLUGIN: Create Structure
PLUGIN ->>- PDTT: Return Structure
PDTT ->> PODS: Import ODS structure
Note right of PDTT: Create hierarchy<br/>AoTest,AoMeasurement,...
PDTT ->>- PODS: Add External Data info
Note right of PDTT: Attach AoFile ... for external data<br/>AoFile,AoSubmatrix,AoLocalColumn,...
end
Note over CLIENT, FILE: Now we can work with the imported files
loop Runtime phase
CLIENT ->> PODS: Establish ODS session
CLIENT ->> PODS: Work with meta data imported from structure
CLIENT ->> PODS: Access external channel in preview
PODS ->> PLUGIN: GetValues
PLUGIN ->> FILE: Get Channel values
PLUGIN ->> PODS: Return values of channels
PODS ->> CLIENT: Return values needed for plot
end
Configuration & Usage
Server Options
python external_data_file.py --help
Key configuration options:
| Option | Default | Description |
|---|---|---|
--port |
50051 | gRPC server port |
--bind-address |
[::] |
Server bind address |
--max-workers |
CPU count × 2 | Thread pool size |
--max-concurrent-streams |
None | Max concurrent gRPC streams |
--use-tls |
False | Enable TLS/SSL |
--tls-cert-file |
- | Path to server certificate (PEM) |
--tls-key-file |
- | Path to server private key (PEM) |
--tls-client-ca-file |
- | CA bundle for client verification |
--require-client-cert |
False | Require valid client certificate |
--verbose |
False | Enable debug logging |
--health-check-enabled |
False | Enable health check service |
TLS Configuration
Basic TLS:
python external_data_file.py \
--use-tls \
--tls-cert-file /path/to/server.crt \
--tls-key-file /path/to/server.key
Mutual TLS (mTLS):
python external_data_file.py \
--use-tls \
--tls-cert-file /path/to/server.crt \
--tls-key-file /path/to/server.key \
--tls-client-ca-file /path/to/client-ca.crt \
--require-client-cert
Docker with TLS:
docker run \
-v /path/to/certs:/certs \
-p 50051:50051 \
ghcr.io/totonga/asam-ods-exd-api-nptdms:latest \
--use-tls \
--tls-cert-file /certs/server.crt \
--tls-key-file /certs/server.key
Development
Setup Development Environment
# Install with development dependencies
pip install -e ".[dev]"
Type Checking
mypy .
Running Tests
python -m unittest discover -s tests
Running Docker Integration Tests
python -m unittest tests.test_docker_integration -v
Code Style
The project uses:
- Black for code formatting
- isort for import sorting
- Pylint for linting
- Mypy for static type checking
Updating Protocol Buffers
The protobuf files are generated from the ASAM ODS standard specifications:
# Download latest proto files
curl -o ods.proto https://raw.githubusercontent.com/asam-ev/ASAM-ODS-Interfaces/main/ods.proto
curl -o ods_external_data.proto https://raw.githubusercontent.com/asam-ev/ASAM-ODS-Interfaces/main/ods_external_data.proto
# Generate Python stubs
mkdir -p ods_exd_api_box/proto
python3 -m grpc_tools.protoc \
-I. \
--python_out=ods_exd_api_box/proto/. \
--pyi_out=ods_exd_api_box/proto/. \
--grpc_python_out=ods_exd_api_box/proto/. \
ods.proto ods_external_data.proto
Performance Considerations
- File Caching - Opened files are cached to minimize I/O operations
- Reference Counting - Automatic resource cleanup with reference counting
- Thread Pool - Configurable worker threads for parallel request handling
- Message Size Limits - Configurable max send/receive message sizes
Troubleshooting
Connection Refused
Ensure the server is running and listening on the correct port:
netstat -tlnp | grep 50051
TLS Certificate Errors
Verify certificate paths and permissions:
openssl x509 -in /path/to/cert.crt -text -noout
Type Checking Failures
Ensure all dependencies are installed with type stubs:
pip install -e ".[dev]"
mypy .
Contributing
Contributions are welcome! Please:
- Use dev container or set up local dev environment
- Ensure type checking passes: `mypy .
- Run tests:
python -m unittest discover -s tests - Follow code style (Black, isort)
- Add tests for new features
License
MIT License - see LICENSE file for details.
References
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 ods_exd_api_box-1.0.1.tar.gz.
File metadata
- Download URL: ods_exd_api_box-1.0.1.tar.gz
- Upload date:
- Size: 47.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5be2020b8f4179687f842f4ce752c5069bf6fe37025cf5e62aaa39e81201f78d
|
|
| MD5 |
271fb799ab2d4684b38fc84a7daf1cf3
|
|
| BLAKE2b-256 |
a20064e62af195a48bbfb6bfa0437447693ddb0bc7269bfe7bcf06f1f96205aa
|
Provenance
The following attestation bundles were made for ods_exd_api_box-1.0.1.tar.gz:
Publisher:
build.yml on totonga/ods-exd-api-box
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ods_exd_api_box-1.0.1.tar.gz -
Subject digest:
5be2020b8f4179687f842f4ce752c5069bf6fe37025cf5e62aaa39e81201f78d - Sigstore transparency entry: 829273685
- Sigstore integration time:
-
Permalink:
totonga/ods-exd-api-box@1c3d024e9644b2db54dabca144c2433685191037 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/totonga
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@1c3d024e9644b2db54dabca144c2433685191037 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ods_exd_api_box-1.0.1-py3-none-any.whl.
File metadata
- Download URL: ods_exd_api_box-1.0.1-py3-none-any.whl
- Upload date:
- Size: 33.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a231d99d3ed0e98173abf0ff859087f3a6ccecc3c3ec4b1594e22624533ac16
|
|
| MD5 |
12688f77fa7c4ebb9b215097d14fa058
|
|
| BLAKE2b-256 |
d6e9fa61cdfe673332e5e1ad0d64721eb2b73ed392ec20d463504af7cee5c7db
|
Provenance
The following attestation bundles were made for ods_exd_api_box-1.0.1-py3-none-any.whl:
Publisher:
build.yml on totonga/ods-exd-api-box
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ods_exd_api_box-1.0.1-py3-none-any.whl -
Subject digest:
7a231d99d3ed0e98173abf0ff859087f3a6ccecc3c3ec4b1594e22624533ac16 - Sigstore transparency entry: 829273687
- Sigstore integration time:
-
Permalink:
totonga/ods-exd-api-box@1c3d024e9644b2db54dabca144c2433685191037 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/totonga
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@1c3d024e9644b2db54dabca144c2433685191037 -
Trigger Event:
push
-
Statement type: