Metadata-Version: 2.1
Name: oem2orm
Version: 0.2.2
Summary: SQLAlchemy module to generate ORM, read from data model in open-energy-metadata(oem-v1.4.0) JSON format
Home-page: https://github.com/OpenEnergyPlatform/data-preprocessing/tree/feature/oep-upload-oem2orm/data-import/oep-upload
Author: henhuy, jh-RLI
Author-email: Hendrik.Huyskens@rl-institut.de
License: UNKNOWN
Project-URL: Bug Reports, https://github.com/OpenEnergyPlatform/data-preprocessing/issues
Project-URL: Source, https://github.com/OpenEnergyPlatform/data-preprocessing/tree/feature/oep-upload-oem2orm/data-import/oep-upload/oem2orm
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: sqlalchemy
Requires-Dist: oedialect
Requires-Dist: jmespath

# OEM to ORM

Create database tables (and schema) from oemetadata json file(s)

## Usage:

This tool is part of the open-energy-metadata (OEM) integration into the [OEP](https://openenergy-platform.org/).
To use this tool with the OEP API you need to be signed up to the OEP since
you need to provide an API-Token. 

If you want to upload OEM that was officially reviewed you must clone the
OEP data-preprocessing repository on GitHub [here](https://github.com/OpenEnergyPlatform/data-preprocessing).
The data-review folder contains all of the successfully reviewed OEM files.

For security reasons, tables can only be created in existing 
schemas and just in the schemas "model_draft" and "sandbox".

Keep in mind the current state is not fully tested. The code is
still quit error prone f.e. the postgres types (column datatype) are not fully 
supported by the [oedialct](https://pypi.org/project/oedialect/) - work in progress.

Step-by-Step: 
1. Create env from requirements.txt, and activate
2. Put the metadata file in the folder metadata or put your own folder in this 
    directory
3. execute the following in a cmd:
```
python oep_oedialect_oem2orm.py
```
4. Provide credentials and folder name in prompt
5. The table will be created 


