Skip to main content

Open Energy Family - Open Metadata Integration OMI

A library and command-line tool to work with Open Energy Metadata (OEMetadata).

  • Free software: AGPL-3.0

Overview

docs

Documentation Status

tests

Test status Coverage Status

package

PyPI Package latest release PyPI Wheel Supported versions Supported implementations
Commits since latest release

Features

OMI provides robust tooling for managing Open Energy Metadata, whether you are using it as a Python library or via the Command Line Interface (CLI):

  • Validation: Validate OEMetadata JSON documents using JSON-Schema and verify open license identifiers against the SPDX license list.

  • Version Conversion: Easily upgrade metadata documents from older OEMetadata specifications to the latest releases.

  • YAML-Based Creation: Scaffold, template, and assemble OEMetadata cleanly using a split-files YAML layout to keep your metadata DRY.

  • Inspection & Skeletons: Automatically infer data schemas from CSV files or inspect SQL databases to generate metadata resource skeletons.

  • Schema Drift Detection: Compare your documented metadata schemas against actual database tables to detect missing columns or type mismatches.

  • OEP Integration: Directly push and pull metadata to and from tables on the Open Energy Platform (OEP).

Installation

You can install the package via pip.

pip install omi

Note: We recommend using the tool uv to manage your python environments.

CLI Quickstart

OMI comes with a powerful CLI to manage your metadata workflow without writing Python code.

Data Requirements: OMI requires you to have your data ready in a tabular format. Currently, only CSV files and PostgreSQL database tables are supported data resources.

When working with local files, OMI expects the structure defined by the Frictionless datapackage standard. Your local directory structure should look something like this:

my_data_publication/
├── datapackage.json            # Optional: In case you already use Frictionless datapackage. Otherwise OMI will help you generate this file.
├── additional_scalars.csv
└── data/
    ├── elements/
    │   ├── biomass_gas-bpchp_heat_high.csv
    │   ├── bus.csv
    │   └── ... (other element CSVs)
    └── sequences/
        ├── electricity-demand_cts_profile.csv
        ├── electricity-wind_profile.csv
        └── ... (other sequence CSVs)

Get an overview of the CLI functionality:

omi --help
omi init --help
omi inspect --help

1. Initialize a new metadata dataset:

omi init dataset ./metadata my_data_publication

2. Inspect tabular data to create resource metadata:

From local CSV files (using the directory structure above):

omi init resources ./metadata my_data_publication my_data_publication/data/elements/*.csv

This creates one <name>.resource.yaml per file, prefilled with the inferred field names and types. The CSV column delimiter is detected per file; pass --delimiter to set it explicitly.

Or, from a database table:

omi init db-resource ./metadata my_data_publication postgresql://user:pass@localhost:5432/db --schema public --table my_table

3. Assemble split YAML files into a final JSON document:

omi assemble --base-dir ./metadata --dataset-id my_data_publication --output-file ./out/my_data_publication_metadata.json

4. Push metadata directly to the OEP: Note: Make sure you already created all tables which are part of you dataset on the OEP. OMI will not do that, for smaller dataset you can use the Wizard on the OEP. For expert users we offer the tool oem2orm which uses the metadata descriptions to generate database tables on the OEP for you. This requires you to already have your data format ready (data files and columns).

omi push-oep-all --base-dir ./metadata --dataset-id my_data_publication --token YOUR_API_TOKEN

For a full list of commands and options, run omi --help.

Note: For backwards compatibility the subcommands are also available without their group, e.g. omi resources ... is the same as omi init resources ....

Documentation

This README provides a minimal overview. For comprehensive guides, Python module API references, and advanced CLI usage, please refer to our official documentation:

  • Current Documentation: Check the docs/ directory in this repository.

  • Legacy Documentation (up to v0.2): omi.readthedocs.io

(Note: We are actively migrating our documentation to MkDocs).

Development

To install additional dependencies for development:

pip install -e .[dev]

We encourage the use of pre-commit-hooks in this project. Those enforce formatting conventions (e.g., isort and black). To enable hooks:

pre-commit install

To run all tests:

tox

Note, to combine the coverage data from all the tox environments run:

Windows

set PYTEST_ADDOPTS=--cov-append
tox

Other

PYTEST_ADDOPTS=--cov-append tox

Metadata

Release files for omi 1.3.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 omi 1.3.0
File Size Uploaded Provenance
omi-1.3.0.tar.gz 115.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for omi 1.3.0
File Interpreter ABI Platform
omi-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 241.5 kB

Release files / omi-1.3.0.tar.gz

Download URL omi-1.3.0.tar.gz
Size 115.3 kB
Tags Source
SHA-256 checksum
How to use checksums
309741589238a6f6092ecb032f820c4c5c478c2418839cc578206682c6a40444
BLAKE2b-256 checksum
How to use checksums
fd5e8bd6ee0beb7796d27762af7866f36752019d34740f18d80f9834357726c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / omi-1.3.0-py3-none-any.whl

Download URL omi-1.3.0-py3-none-any.whl
Size 126.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f2c5a27fc0774a14739d20a02d2259bc91fa0e642cdd1112a506b4c72fb0d0c
BLAKE2b-256 checksum
How to use checksums
05c987d4e039b758c297e12f95f1199fc4b4369a15e22dea891d9dd698d8644b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for omi 1.3.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.

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