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.0.tar.gz (4.3 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.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: em_data_ingester-1.0.0.tar.gz
  • Upload date:
  • Size: 4.3 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.0.tar.gz
Algorithm Hash digest
SHA256 b6ce8af213bca6a5ae3917c9a97275a143fa76b77776ea0301c3c76666a3b9fe
MD5 095f4c0a2d7f91a99d62064419237239
BLAKE2b-256 dc0529a0254d104862f08c11bba98d6625ee8908bbf16493cf495beaf3174481

See more details on using hashes here.

Provenance

The following attestation bundles were made for em_data_ingester-1.0.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for em_data_ingester-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a4772ccbee3d96b7b1abbe4263055496849e6c3f21c60e5f962d16e55e37b9f
MD5 e10ae8bf79ea28298b985f032400e6e3
BLAKE2b-256 87ef365038ffb9b37f516b9df946562519a436e2f86841672cfdae97cf98a9b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for em_data_ingester-1.0.0-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