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.1.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.1-py3-none-any.whl (76.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: owi_metadatabase_shm-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 fd4423c2df0f46672e29c7418c80c9079dde7ec6415eee91302e73c854ba3479
MD5 666fc77c0acf16a97bfaa32c1310f5fa
BLAKE2b-256 e88ec9be23d3e90092b4a4755b0c08e67739c38edaa944e263b4f4167e90450c

See more details on using hashes here.

Provenance

The following attestation bundles were made for owi_metadatabase_shm-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for owi_metadatabase_shm-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8ffbd16c84cb88542a8d21c264bce71471e8468726cc7dd2746bbccfa1ac438a
MD5 451b519f3f49db4e6c806734d40ec1e5
BLAKE2b-256 7744702281c46ab8ddcce458e16095dcdd66b6b1cb0bfb17d7875ce9392db1b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for owi_metadatabase_shm-0.1.1-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