Skip to main content

Python API Wrapper for Measurement Data

Project description

PyPI PyPI - Status PyPI - Python Version PyPI - Wheel PyPI - Downloads

MeaPy

Python API Wrapper for Measurement Data

Vision

MeaPy wants to be a easy-to-use and conformable API for working with measurement data in den Big Test Data environment.

Getting Started

pip install meapy

Usage

To create a meapy session, you need to connect to the MaDaM system.n

from meapy import MeaPy, MeasurementList, LoadingConfig

# "Basic " is the content if the HTTP Authorization-Header. In this example it is the Basic Authentication Header for user:password
mp = MeaPy("http://madam-docker.int.kistler.com:8081/", "Basic dXNlcjpwYXNzd29yZA==")

Search

# direct search (by default limited to 100 results)
result = mp.search("test")
# result is a list of meapy.Measurement

# search and iteration over the whole result set
ml = MeasurementList(mp)
count = 0
for mea in ml.items('Station.Id="d4f1ad55-72d5-403c-81b8-73b2942b58f4"'):
    count+=1
print(count)

Loading Signals

The measurements that were returned from the search can be used to load the signals directly from the MaDaM system.

result = mp.search("test", limit = 1)
measurement = result[0]

# load a measurement
config = LoadingConfig()
config.withSignals(['time'])
signals = mp.load(measurement, config)
# signals is a list of meapy.SignalData that contains the information for the requested channels

Update Measurement Metadata

result = mp.search("test", limit = 1)
measurement = result[0]

# update the metadata with some additional data
data = {'someField': 'someValue'}
mp.update(measurement, data)

Upload a new Measurement

# upload a pandas DataFrame to MaDaM with a given name.
df = pd.DataFrame(np.random.randint(0, 100, size=(100, 4)), columns=list('ABCD'))

# you can also add some additional metadata here
data = {'someField': 'someValue'}
mp.upload("random-data", df, data)
# after successful upload, you can find the new measurement "random-data.csv"

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

meapy-0.0.13.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

meapy-0.0.13-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file meapy-0.0.13.tar.gz.

File metadata

  • Download URL: meapy-0.0.13.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.5

File hashes

Hashes for meapy-0.0.13.tar.gz
Algorithm Hash digest
SHA256 4c9f4192f2c0c2da9b6c86a7b33dc29b17f2eb25805c7756e3acee232abef524
MD5 eb3f07f910d5f6c7ce9bc7811e262c47
BLAKE2b-256 bb1805f512823ce9eb36a83e98eb36caac1c32bffa3a5d28b4c9a6a735adebb3

See more details on using hashes here.

File details

Details for the file meapy-0.0.13-py3-none-any.whl.

File metadata

  • Download URL: meapy-0.0.13-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.5

File hashes

Hashes for meapy-0.0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 bdde27e0da6dce6cd6548048d69b28950b25d063493b66eb0001dfb80fb41726
MD5 69f03018de7c0989bdafc6307be932c6
BLAKE2b-256 1ffa2ea0d59dc5b79cb4b8919060ab3067a0efd131302647f4d052edb77082b3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page