Skip to main content

Prime STG-DC Interface Specification

Project description

Build status Build status

Python library of Prime STG-DC Interface Specification

Read the documentation at http://primestg.readthedocs.org

How it works

from primestg.report import Report

# xml is a basestring with a filename or a file object with the report
report = Report(xml)

# get all values of the report
values = report.values

# get the values of first concentrator
values = report.concentrators[1].values

# get the values of second meter of the first concentrator
values = report.concentrators[1].meters[2].values

# get the first value set of second meter of the first concentrator
values = report.concentrators[1].meters[2].measures[1].values

# get the parameters of the first concentrator from report S12
values = report.concentrators[1].parameters[1].values

Warnings property

All reports supported by the library have a warnings property that informs of problems found while parsing the contents of it. Depending on the type of report the warnings will be structured one way or another.

Meter information report:

The best way to get the warnings for these reports would be asking for the warnings of every meter in it.

for meter in cnc.meters:
    if meter.warnings:
        warnings.append(meter.warnings)

These will give us a list of dictionaries where each of them will have the serial name of the meter as a key and a list of strings with every exception found while reading as a value.

Concentrator information report:

To obtain the warnings from a concentrator report we will use the warnings property from the concentrator object directly.

for cnc in self.report[key].concentrators:
    if cnc.warnings:
        warnings.append(cnc.warnings)

This give us a list of strings where each one is the message of an exception found while reading.

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

primestg-1.52.1.tar.gz (46.0 kB view details)

Uploaded Source

Built Distribution

primestg-1.52.1-py3-none-any.whl (48.6 kB view details)

Uploaded Python 3

File details

Details for the file primestg-1.52.1.tar.gz.

File metadata

  • Download URL: primestg-1.52.1.tar.gz
  • Upload date:
  • Size: 46.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for primestg-1.52.1.tar.gz
Algorithm Hash digest
SHA256 462e79a20ac92f3dba16f2aed59945e758873ae63bd241f9e8b5438b4517f648
MD5 c75e77efbea371dc63357207f6b8c4b6
BLAKE2b-256 165619fd43eb07b2ca090c446c762335ab84345b329e678c11b2c9417bb329aa

See more details on using hashes here.

File details

Details for the file primestg-1.52.1-py3-none-any.whl.

File metadata

  • Download URL: primestg-1.52.1-py3-none-any.whl
  • Upload date:
  • Size: 48.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for primestg-1.52.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4d52c7cb08a1981b74f2f99ea1f660c76209e8207b412130bd649a44891c29c8
MD5 00851f0f999e39b2e52b3d644b65ad91
BLAKE2b-256 9cef96879a22e9c5f37bbb858e93d8e08f2e0762f0066adbe7e26cdfa22e5670

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