Metadata-Version: 2.1
Name: omi
Version: 0.0.9
Summary: A library to process and translate open energy metadata.
Home-page: https://github.com/OpenEnergyPlatform/omi
Author: Martin Glauer
Author-email: martinglauer89@gmail.com
License: AGPL-3.0
Project-URL: Documentation, https://omi.readthedocs.io/
Project-URL: Changelog, https://omi.readthedocs.io/en/latest/changelog.html
Project-URL: Issue Tracker, https://github.com/MGlauer/omi/issues
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Operating System :: Unix
Classifier: Operating System :: POSIX
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Utilities
Requires-Python: >=3.5
Provides-Extra: dev
License-File: LICENSE
License-File: AUTHORS.rst

==================================================
Open Energy Family - Open Metadata Integration OMI
==================================================

Overview
========



A library to process and translate open energy metadata.

* Free software: AGPL-3.0

Installation
============

::

    pip install omi

Documentation
=============


https://omi.readthedocs.io/

Usage
=====

**Parse, Compile, Render, Convert and Validate**
Omi can read(parse), compile, Render(json compilant), convert(convert metadata from v1.4 to v1.5 structure) and validate - a json 
file or object that is compliant with the oemetadata spec. This is usefull to do various operations that help to integrate with - as 
well as in interact with the oemetadata. Some parts of this tool might still be volatile but the code quality is conventionsly improved 
as this module is a core component of the oeplatfroms metadata integration system.

Check if omi is able to read a oemetadata file (for version 1.4 and 1.5)
CLI - oemetadata version 1.5::

    omi translate -f oep-v1.5 examples/data/metadata_v15.json

CLI - oemetadata version 1.4::

    omi translate -f oep-v1.4 -t oep-v1.4 examples/data/metadata_v14.json

omi is able to read a JSON file and parse it into one of the internal Python structures (depending on the oemetadata version). 
The OEPMetadata Python object can then be compiled and converted back to JSON. You can manipulate a successfully parsed 
OEPMetadata object.

Module usage::

    from omi.dialects.oep.dialect import OEP_V_1_3_Dialect, OEP_V_1_4_Dialect, OEP_V_1_5_Dialect
    inp = '{"id":"unique_id"}' #or read from json file
    dialect1_5 = OEP_V_1_5_Dialect()
    parsed = dialect1_5.parse(input)
    print(parsed)
    parsed.identifier = "another_unique_id"
    compiled = dialect1_5.compile(parsed)
    print(compiled)


**Conversion**

To ease the conversion of oemetadata from the outdated version 1.4 to the latest version, we provide
conversion functionality. The following example shows how to convert the oemetadata from v1.4 to v1.5
by using a CLI command.

CLI - oemetadata conversion from v1.4 to v1.5::

    omi convert -i {input/path} -o {output/path} 


Development
===========

To install additional dependencies for development::

    pip install -e .[dev]

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

    pre-commit install

To run the all tests run::

    tox

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

.. list-table::
    :widths: 10 90
    :stub-columns: 1

    - - Windows
      - ::

            set PYTEST_ADDOPTS=--cov-append
            tox

    - - Other
      - ::

            PYTEST_ADDOPTS=--cov-append tox


Changelog
=========

current (2022-XX-XX)
--------------------


0.0.9 (2022-10-31)
--------------------

* Fix bug that is raised if the input oemetadata does not contain the key _comment (PR#74) 

0.0.8 (2022-10-20)
--------------------

* Add conversion to translate oemetadata from v1.4 to v1.5
* Add conversion option to OMIs CLI application
* Add conversion additional script that converts oemetadata from v1.4 to v1.5 without using OMI. thanks to @chrwm

* Fix oeo related isAbout and valueReference field names (PR#65)
* Introduce github actions: Add automation worfklows for pypi publish for test and official (PR#67)
* Introduce new directory and provide some use cases and example implementation for omi usage and improve general code quality (PR#61)
* Reintroduce automated testing (CI) that icludes omi unit test (parser, compiler) and more (PR#69)

0.0.7 (2022-06-02)
------------------

* Add oem_structure module: Introcude support for multipe OEMetadata structure representations
* add new Dialect for OEM v15
* Full support (except for validation) for OEP-Metadata v1.5


0.0.6 (2020-07-08)
------------------

* Fix compilation of null values
* Fix parsing of lists


0.0.5 (2020-05-12)
------------------

* Fixed compiler for None in date fields


0.0.4 (2019-12-06)
------------------

* Improved documentation
* Full support of OEP-Metadata 1.4
* Support for optional fields in metadata strings
