Skip to main content

SQLAlchemy module to generate ORM, read from data model in open-energy-metadata(oem-v1.4.0) JSON format

Project description

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. 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. 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 - 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
  1. Provide credentials and folder name in prompt
  2. The table will be created

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

oem2orm-0.2.2.tar.gz (5.7 kB view hashes)

Uploaded Source

Built Distribution

oem2orm-0.2.2-py3-none-any.whl (18.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page