Skip to main content

Generate data-related artifacts from an Entity-Relationship diagram

Project description

Zepster: Model-Driven Engineering Toolset for Data

Zepster implements Model-Driven Engineering (MDE) for data. It creates a consistent set of data-related artifacts to drive development with

  • better alignment among business stakeholders and developers
  • fewer bugs
  • increased productivity

Summary

Zepster lets you:

  • Use Entity-Relationship Modeling to describe entitites, attributes, and the relationships between entities in an Entity-Relationship Diagram (ERD)
  • Convert ERDs into Entity-Relationship Markup Language (ERML) files
  • Generate data-related files from the ERML, such as:
    • Relational database schema
    • Database catalog
    • Python enum definitions

Details

Entity-Relationship Modeling Using yEd Graph Editor

First, create an ERD for your business use case, using yEd graph editor. The yEd application is free and is available for MacOS, Linux, and Windows.

With yEd you can create a diagram that shows

  • business entities
  • their attributes
  • how entities are related to each other

The resulting diagram is saved as a GraphML file, which is an industry-standard format for graphs.

Generate Entity-Relationship Markup Language (ERML) File

Next, generate an Entity-Relationship Markup Language (ERML) file from the saved GraphML diagram file. To do this, use the generml script:

Usage: generml.py [OPTIONS]

  Read an Entity-Relationship diagram created by the yEd graph editor and
  convert it into Entity-Relationship Markup Language

  References:
  yEd - https://www.yworks.com/products/yed
  GraphML - http://graphml.graphdrawing.org/index.html

Options:
  --input TEXT    Input GraphML file (default is standard input, also
                  represented by a dash "-")
  --output TEXT   Output ERML file (default is standard output, also
                  represented by a dash "-")
  --overwrite     If specified, overwrite the output file if it already exists
  --logging TEXT  Set logging to the specified level: NOTSET, DEBUG, INFO,
                  WARNING, ERROR, CRITICAL
  --help          Show this message and exit.

The ERML is an intermediate language that decouples downstream tools (such as the relational database schema generator) from the specific graph editor tool (yEd). In theory, any tool that creates ERML can serve as an input source for generating downstream files.

After generating the ERML file, you can generate a number of things, described below.

Generate SQL Relational Database Schema Definitions

Next, you can generate the schema definitions that define the tables for a relational database, using SQL. To do this, use the genschema script:

Usage: genschema.py [OPTIONS]

  Read an Entity-Relationship Markup Language file and write a database
  schema SQL file

Options:
  --input TEXT    Input Entity-Relationship Markup Language file (default is
                  standard input, also represented by a dash "-")
  --output TEXT   Output schema definition file (default is standard output,
                  also represented by a dash "-")
  --overwrite     If specified, overwrite the output file if it already exists
  --logging TEXT  Set logging to the specified level: NOTSET, DEBUG, INFO,
                  WARNING, ERROR, CRITICAL
  --dialect TEXT  Set the database dialect: (currently only "crdb")
  --help          Show this message and exit.

Generate Database Catalog Using Markdown

You can also generate a database catalog to document the database for users. The catalog is created using GitHub-flavored Markdown format. To do this, use the gencatalog script:

Usage: gencatalog.py [OPTIONS]

  Read an Entity-Relationship Markup Language
  file and write a data catalog output file

Options:
  --input TEXT    Input Entity-Relationship Markup Language file (default is
                  standard input, also represented by a dash "-")
  --output TEXT   Output catalog file (default is standard output, also
                  represented by a dash "-")
  --overwrite     If specified, overwrite the output file if it already exists
  --logging TEXT  Set logging to the specified level: NOTSET, DEBUG, INFO,
                  WARNING, ERROR, CRITICAL
  --format TEXT   Set the catalog format: (currently only "md")
  --help          Show this message and exit.

Generate Python Enum Definitions

You can also generate Python enum definitions from the ERML file. This can reduce application bugs. To do this, use the genpyenums script:

Usage: genpyenums.py [OPTIONS]

  Generate Python enum declarations from an Entity-Relationship Markup
  Language (ERML) file

Options:
  --input TEXT    Input Entity-Relationship Markup Language file (default is
                  standard input, also represented by a dash "-")
  --output TEXT   Output schema definition file (default is standard output,
                  also represented by a dash "-")
  --overwrite     If specified, overwrite the output file if it already exists
  --logging TEXT  Set logging to the specified level: NOTSET, DEBUG, INFO,
                  WARNING, ERROR, CRITICAL
  --help          Show this message and exit.

Copyright 2020 Cisco Systems, Inc. and its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License

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

zepster-0.1.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

zepster-0.1-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

Details for the file zepster-0.1.tar.gz.

File metadata

  • Download URL: zepster-0.1.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.2

File hashes

Hashes for zepster-0.1.tar.gz
Algorithm Hash digest
SHA256 c9a971ccad66c2d3db7a7e55e9bf6e05f3a71869b1411d955775db47a5f93e50
MD5 8eac35d3face9cc4bb19564c06022381
BLAKE2b-256 8ae44ec44a7e5ace10c897c12df2bb003f08c4f05ccaac929e012e292383c612

See more details on using hashes here.

File details

Details for the file zepster-0.1-py3-none-any.whl.

File metadata

  • Download URL: zepster-0.1-py3-none-any.whl
  • Upload date:
  • Size: 25.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.2

File hashes

Hashes for zepster-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3adef53569032e50cd9952bd41bf9114272501fb12b054056b9d76145397e732
MD5 5586d1e5b32e497e4fe00310071893a4
BLAKE2b-256 9a68b6ff6f7bccb6222187e1aae5ffd3f7dd48a014eead587140c12b84f24f49

See more details on using hashes here.

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