Skip to main content

PrimeSTG

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.

Metadata

Release files for primestg 1.69.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for primestg 1.69.0
File Size Uploaded Provenance Actions
primestg-1.69.0.tar.gz 55.2 kB Without provenance Details for primestg-1.69.0.tar.gz

Release files / primestg-1.69.0.tar.gz

Download URL primestg-1.69.0.tar.gz
Size 55.2 kB
Tags Source
SHA-256 checksum
How to use checksums
17940d4c5d8f39afa628e0b6a2cbbebf8f764b399048767bb67f852eaf5bc5c8
BLAKE2b-256 checksum
How to use checksums
d9a12e2f831d2a3d220c55058790c449272094da60dcd28b5a740a8bf21cb036
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for primestg 1.69.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.69.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page