Home Applications smart-grid-pyprod

smart-grid-pyprod

InterSystems does not provide technical support for this project. Please contact its developer for the technical assistance.
0
0 reviews
0
Awards
7
Views
0
IPM installs
0
0
Details
Releases (1)
Reviews
Issues
Example of PyProd usage

What's new in this version

Initial Release

Smart Grid PyProd Production

A Pure Python InterSystems IRIS Interoperability production built based on PyProd.

This project demonstrates how to build a complete InterSystems IRIS production entirely in Python that ingests CSV smart-meter readings, validates the file structure, performs analytics, and stores the results in an IRIS SQL table.

The implementation is based on the PyProd framework and follows the same architectural style as the https://github.com/gabriel-ing/csvgen-pyprod sample.

Architecture

CSV Files
     │
     ▼
CSVFileInboundAdapter
     │
     ▼
SmartMeterFileService
     │
     ▼
SmartMeterAnalysisProcess
     │
     ▼
SmartMeterDBOperation
     │
     ▼
EnergyOps.SmartMeterReadings

The production performs the following steps:

  1. Polls an input directory for CSV files.
  2. Moves the file to a processing directory.
  3. Validates the CSV structure.
  4. Calculates:
    • Total kWh consumed in the file
    • Average kWh consumed
    • Peak meter ID
    • Peak kWh reading
  5. Inserts every CSV row into an IRIS SQL table together with the calculated file statistics.
  6. Archives the processed CSV.

Build

Clone the repository

git clone https://github.com/Gra-ach/smart-grid-pyprod.git
cd smart-grid-pyprod

Start up the Docker container:

docker-compose up --build -d

Run

Open the Management Portal
http://localhost:62773/csp/ensemble/EnsPortal.ProductionConfig.zen?PRODUCTION=EnergyOps.SmartGridProduction
and start the production.

Input Files

Copy CSV files into

Data/input

Processing

When a file is detected:

  • it is moved to Data/processing
  • validated
  • analysed
  • inserted into SQL
  • moved to Data/archive

SQL Table

The production automatically creates

EnergyOps.SmartMeterReadings

if it does not already exist.

Each inserted row contains

  • original meter reading
  • source filename
  • file total kWh
  • file average kWh
  • peak meter
  • peak kWh

View Results

Using SQL

SELECT *
  FROM EnergyOps.SmartMeterReadings;

Interoperability Components

Inbound Adapter

  • Polls an input directory
  • Detects CSV files
  • Moves files to the processing directory

Business Service

  • Reads CSV headers
  • Creates a SmartMeterFileMessage

Business Process

  • Validates the CSV schema

  • Calculates

    • total consumption
    • average consumption
    • peak meter

Business Operation

  • Creates the SQL table if required
  • Inserts every CSV record
  • Archives processed files

References

Made with
Install
zpm install smart-grid-pyprod
Version
1.0.028 Jun, 2026
Ideas to the app
https://ideas.intersystems.com/ideas/DPI-I-955
Category
Technology Example
Works with
InterSystems IRIS
First published
28 Jun, 2026
Last edited
28 Jun, 2026