Skip to main content

SHM extension for OWI Metadatabase SDK

Project description

OWI Metadatabase SHM Extension

SHM (Structural Health Monitoring) extension for the OWI Metadatabase SDK.

version python versions license pytest lint issues Documentation

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.

📚 Read the Documentation

What the SDK Covers

  • Query and create SensorType, Sensor, and SensorCalibration records.
  • Query and create Signal, DerivedSignal, SignalHistory, DerivedSignalHistory, SignalCalibration, and DerivedSignalCalibration records.
  • 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.ipynb
  • scripts/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
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


Download files

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

Source Distribution

owi_metadatabase_shm-0.1.2.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

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

owi_metadatabase_shm-0.1.2-py3-none-any.whl (76.5 kB view details)

Uploaded Python 3

File details

Details for the file owi_metadatabase_shm-0.1.2.tar.gz.

File metadata

  • Download URL: owi_metadatabase_shm-0.1.2.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for owi_metadatabase_shm-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c1170c6caa72500eb061ee41e0a2d9c5e8a05adf9cba8b9859b19c8d3afa7835
MD5 0b45643807c302b439b0eec1dec66758
BLAKE2b-256 67348f285d53757eb3d11cade14bad6e2b6876383793eb83ab2e7b676e1e6931

See more details on using hashes here.

Provenance

The following attestation bundles were made for owi_metadatabase_shm-0.1.2.tar.gz:

Publisher: publish.yml on OWI-Lab/owi-metadatabase-shm-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file owi_metadatabase_shm-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for owi_metadatabase_shm-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3d14b90c4301d798bfe6e4481aaa89cf8d81716050c90b474afaa9d9668d8a6f
MD5 c958b1adc91fc374436520c5dabdf1b5
BLAKE2b-256 00456ba639b0a60694b49e0d0048c8a91f34b3a1ec3396a914b5d7ea19a8f647

See more details on using hashes here.

Provenance

The following attestation bundles were made for owi_metadatabase_shm-0.1.2-py3-none-any.whl:

Publisher: publish.yml on OWI-Lab/owi-metadatabase-shm-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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