Skip to main content

Python library for pushing data to the Energy Mutual (Konductor) platform

Project description


Logo

em-data-ingester

Python helper module for publishing data to the Energy Mutual platform

About Energy Mutual

Energy Mutual helps owners of distributed energy assets make the most of their renewable resources.

Check us out at energymutual.com

Getting Started

Prerequisites

You will need the following. Please contact Energy Mutual Support if you do not have them already.

  1. Certificate files
    • private.pem.key
    • certificate.pem.crt
    • CA.pem
  2. Your client_id and topic

Python 3.9 or newer is required.

Installation

pip install em-data-ingester

or, with uv:

uv add em-data-ingester

Usage

All examples below assume the following:

  • client_id of EM123456
  • topic of MyTopicName
  • All required key/certificate files in a certificates/ subdirectory

Creating an EMDataIngester and connecting

from em_data_ingester import EMDataIngester

ingester = EMDataIngester(
    client_id="EM123456",
    topic="MyTopicName",
    key_path="certificates/private.pem.key",
    cert_path="certificates/certificate.pem.crt",
    ca_path="certificates/CA.pem",
)

ingester.connect()

Adding attributes to the payload

from datetime import datetime, timezone

# Add a powerOutput reading (timestamp defaults to now, UTC)
ingester.add_to_payload("powerOutput", 123, units="kW")

# Or pass an explicit datetime
ingester.add_to_payload(
    "reservoirLevel",
    10,
    dt=datetime.now(timezone.utc),
    units="m",
)

Adding the same attribute name more than once will overwrite the previous value.

Sending the payload

ingester.send_payload()

This will clear the payload after a successful publish.

Clearing the payload

ingester.clear_payload()

Viewing the payload

print(ingester.payload)

Closing the connection (Important!)

ingester.end()

Context manager

EMDataIngester also works as a context manager, which connects on entry and closes the connection on exit:

with EMDataIngester(
    client_id="EM123456",
    topic="MyTopicName",
    key_path="certificates/private.pem.key",
    cert_path="certificates/certificate.pem.crt",
    ca_path="certificates/CA.pem",
) as ingester:
    ingester.add_to_payload("powerOutput", 123, units="kW")
    ingester.send_payload()

(back to top)

Contact

Energy Mutual - info@energymutual.com

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

em_data_ingester-1.0.1.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

em_data_ingester-1.0.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file em_data_ingester-1.0.1.tar.gz.

File metadata

  • Download URL: em_data_ingester-1.0.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for em_data_ingester-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d529567a32ee557069a0cbf60941f14173e910ed088172126934bb06d1c77f7a
MD5 7ac3681d3422a89304a4e6c15991da13
BLAKE2b-256 08f9beef77d19db5ffe098f292728a9de04d598e2d579f294cc7cc416c69e258

See more details on using hashes here.

Provenance

The following attestation bundles were made for em_data_ingester-1.0.1.tar.gz:

Publisher: publish.yml on Energy-Mutual/data-ingester-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file em_data_ingester-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for em_data_ingester-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9618a396dd109143c0ff7753f8dc1ec747bb5f8a3dd45cdf57e89664073a8615
MD5 ba01b99f7b38ea987ef49ad23829b35f
BLAKE2b-256 a64a2311955f6d389c3a2c3f0949117aad6a7cb1ec12bf36a430b0b16fc0f621

See more details on using hashes here.

Provenance

The following attestation bundles were made for em_data_ingester-1.0.1-py3-none-any.whl:

Publisher: publish.yml on Energy-Mutual/data-ingester-py

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