Skip to main content

This package provides a Python implementation of a metadata scheme for time-series with measurement uncertainties.

Project description

time-series-metadata

A metrologically enabled time-series metadata scheme

time-series-metadata is a Python implementation of a metadata scheme for time-series with measurement uncertainties. It is developed jointly by software developers and researchers from Physikalisch-Technische Bundesanstalt (Germany) and Institute for Manufacturing (UK) as part of the joint European Research Project EMPIR 17IND12 Met4FoF and the German research project FAMOUS.

time-series-metadata is written in Python 3 and strives to run with all Python versions with upstream support. Currently it is tested to work with Python 3.5 to 3.8.

Scheme

The following image illustrates an abstract representation of a time series:

time-series metadata scheme illustration

The scheme contains all metadata to interpret the actual time and quantity values.

It is comprised of a dictionary containing the following keys with (default) values of the specified type:

metadata = {
    "device_id": string (default: ""),
    "time_name": string (default: "time"),
    "time_unit": string (default: "om:second"),
    "quantity_names": string or list of strings (default: ""),
    "quantity_units": string or list of strings (default: ""),
    "misc": optional, any other data you want to provide (default: None),
}

Example use

We illustrate the use of the scheme assuming you already have a project set up.

Installation

First you need to install the scheme with the usual command into your project's Python virtual environment:

pip install time-series-metadata

Import scheme

Inside your project's code import the scheme at the top of your module.

from time_series_metadata.scheme import MetaData

Assign initial values

After importing the package you can make use of it and assign initial values.

vs_description = MetaData(
    device_id="my_virtual_sensor",
    time_name="time",
    time_unit="s",
    quantity_names=("pressure_1", "pressure_2"),
    quantity_units=("Pa","mPa"),
    misc="additional information"
)

Read out metadata

You can access previously provided metadata in several ways.

Read out metadata

You can access the whole metadata set or time and quantity metadata separately. Quantity metadata can be either accessed for all quantities or individually via index or name.

>>> vs_description.metadata
{'device_id': 'my_virtual_sensor', 'time_name': 'time', 'time_unit': 's', 'quantity_names': ['pressure'], 'quantity_units': ['Pa'], 'misc': None}
>>> vs_description.time
{'time_name': 'time', 'time_unit': 's'}
>>> vs_description.quantities
{'quantity_names': ('pressure_1', 'pressure_2'), 'quantity_units': ('Pa', 'mPa')}
>>> vs_description.get_quantity(1)
{'quantity_names': 'pressure_2', 'quantity_units': 'mPa'}
>>> vs_description.get_quantity(name="pressure_1")
{'quantity_names': 'pressure_1', 'quantity_units': 'Pa'}

Maintainers

The package is developed and maintained at the "Physikalisch-Technische Bundesanstalt" by Maximilian Gruber and Björn Ludwig.

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

time_series_metadata-0.1.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

time_series_metadata-0.1.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file time_series_metadata-0.1.0.tar.gz.

File metadata

  • Download URL: time_series_metadata-0.1.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for time_series_metadata-0.1.0.tar.gz
Algorithm Hash digest
SHA256 62c0e24aae248ff3d0e8fb27734d641800dd262d52a59e971fc6c74244098d16
MD5 d57fbc5c1e37308824da51a1c569a1a9
BLAKE2b-256 d19db02675851f8a3530da011674f51551508e77b076156aa56a81cbe799d547

See more details on using hashes here.

File details

Details for the file time_series_metadata-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: time_series_metadata-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for time_series_metadata-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 12b03e325476c2f78241b6a83b5e7f07585671b61de87d95e6f859453ea57fd6
MD5 fcbea3d122e1fb17fdfd1e838f03ed82
BLAKE2b-256 5df106508f74bf18eef52dca2d612bd7c28ffc14c3b5d33cf4c62ea26ae70486

See more details on using hashes here.

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