SHM extension for OWI Metadatabase SDK
Project description
OWI Metadatabase SHM Extension
SHM (Structural Health Monitoring) extension for the OWI Metadatabase SDK.
This package extends
owi-metadatabase under the
owi.metadatabase.* namespace with a typed SHM layer for sensors, signals,
history, and calibration records.
The package is structured in the same style as the results SDK: low-level HTTP
transport stays in ShmAPI, while typed models, serializers, a registry, and
domain services sit above it. Upload workflows use the same typed surface and
stable helper modules instead of the removed legacy package.
What the SDK Covers
- Query and create
SensorType,Sensor, andSensorCalibrationrecords. - Query and create
Signal,DerivedSignal,SignalHistory,DerivedSignalHistory,SignalCalibration, andDerivedSignalCalibrationrecords. - Process raw configuration files into upload-ready signal mappings.
- Upload sensors and signals through reusable orchestrators that can run against either the live backend or test doubles.
Package Shape
The public surface is organized around a few clear layers:
ShmAPI: low-level transport and endpoint operations.models,serializers,registry,services: typed entity layer for SHM records and repository-backed workflows.processing: signal configuration parsing and transformation.upload: sensor and signal upload orchestration.json_utils,signal_ids,upload_context,upload.payloads: stable helper modules used by processing and upload workflows.
Installation
uv add owi-metadatabase-shm
Or as a core-package extra:
uv add "owi-metadatabase[shm]"
For local development:
uv sync --all-packages --all-extras --all-groups
Quick Start
Query the SHM backend
from owi.metadatabase.shm import ShmAPI
api = ShmAPI(
api_root="https://owimetadatabase.azurewebsites.net/api/v1",
token="your-api-token",
)
print(api.ping())
Work with the typed services
from owi.metadatabase.shm import ApiShmRepository, SensorService, ShmAPI
api = ShmAPI(
api_root="https://owimetadatabase.azurewebsites.net/api/v1",
token="your-api-token",
)
repository = ApiShmRepository(api)
sensor_service = SensorService(repository=repository)
sensor_type = sensor_service.get_sensor_type(name="393B04")
print(sensor_type)
Upload sensors
from owi.metadatabase.shm import ShmAPI, ShmSensorUploader
api = ShmAPI(token="your-api-token")
uploader = ShmSensorUploader(shm_api=api)
# Upload sensor types, sensors, and calibrations
uploader.upload_sensor_types(sensor_types_data, permission_group_ids=[1])
uploader.upload_sensors("accelerometers", {"name": "393B04"}, sensors_data, [1])
Process and upload signals
from owi.metadatabase.shm import (
DefaultSignalConfigProcessor,
ShmAPI,
ShmSignalUploader,
)
processor = DefaultSignalConfigProcessor(path_configs="data/signal_configs/")
processor.signals_process_data()
uploader = ShmSignalUploader.from_clients(shm_api=api, locations_client=..., geometry_client=...)
results = uploader.upload_from_processor(projectsite="MyFarm", processor=processor)
Notebook Suite
The repository ships with two executable notebooks under notebooks/:
scripts/1.0.upload-sensors.ipynbscripts/2.0.upload-signals.ipynb
They are designed to run top-to-bottom with bundled Norther example data and exercise the public SDK surface without requiring a live backend.
Execute them with:
cd scripts
uv run jupyter nbconvert --to notebook --execute 1.0.upload-sensors.ipynb
uv run jupyter nbconvert --to notebook --execute 2.0.upload-signals.ipynb
Documentation
Full documentation is available at owi-lab.github.io/owi-metadatabase-shm-sdk.
Development
uv sync --all-packages --all-extras --all-groups
uv run invoke qa
uv run invoke test.all
uv run invoke docs.build
cd scripts
uv run jupyter nbconvert --to notebook --execute 1.0.upload-sensors.ipynb
uv run jupyter nbconvert --to notebook --execute 2.0.upload-signals.ipynb
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 owi_metadatabase_shm-0.1.0.tar.gz.
File metadata
- Download URL: owi_metadatabase_shm-0.1.0.tar.gz
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f36f18494f452255793ad1f666d8828797bd1f939d134a507641c53db7436c16
|
|
| MD5 |
03abe68552871c99488b404d8c0b3ba2
|
|
| BLAKE2b-256 |
115dc7c8925aff4907e1e4b4a3c5661d79a13e94bb4f7d282287216db50c5d2a
|
Provenance
The following attestation bundles were made for owi_metadatabase_shm-0.1.0.tar.gz:
Publisher:
publish.yml on OWI-Lab/owi-metadatabase-shm-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
owi_metadatabase_shm-0.1.0.tar.gz -
Subject digest:
f36f18494f452255793ad1f666d8828797bd1f939d134a507641c53db7436c16 - Sigstore transparency entry: 1181742482
- Sigstore integration time:
-
Permalink:
OWI-Lab/owi-metadatabase-shm-sdk@57e769986170361a056a4d7fbe3c9f7877e0d1b5 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/OWI-Lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@57e769986170361a056a4d7fbe3c9f7877e0d1b5 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file owi_metadatabase_shm-0.1.0-py3-none-any.whl.
File metadata
- Download URL: owi_metadatabase_shm-0.1.0-py3-none-any.whl
- Upload date:
- Size: 75.4 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 |
60239665612800f6a418a8daf9b58161c19d22341273a4fd625425fa1eed5bec
|
|
| MD5 |
e6d9aa40a7e62ef7344ef3c9e33d9aa3
|
|
| BLAKE2b-256 |
610f30d50cdf48ea0aa0e45d2386d826664a0fba1be342df65e6a723eb9ab44e
|
Provenance
The following attestation bundles were made for owi_metadatabase_shm-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on OWI-Lab/owi-metadatabase-shm-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
owi_metadatabase_shm-0.1.0-py3-none-any.whl -
Subject digest:
60239665612800f6a418a8daf9b58161c19d22341273a4fd625425fa1eed5bec - Sigstore transparency entry: 1181742499
- Sigstore integration time:
-
Permalink:
OWI-Lab/owi-metadatabase-shm-sdk@57e769986170361a056a4d7fbe3c9f7877e0d1b5 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/OWI-Lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@57e769986170361a056a4d7fbe3c9f7877e0d1b5 -
Trigger Event:
workflow_dispatch
-
Statement type: