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.1.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: zepster-0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 b3324b9f5b98c4b13f87089a6d0df540fa23f79f540dbe352c17a29da51ac009
MD5 b35ea94f267bf308b86d1b13ace6d29c
BLAKE2b-256 756d4f215f78b698f0ad7ea774b0ceb1a8fc7a1461d054323dd8e03fb4e554e2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zepster-0.1.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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4a28f0721f21a8e29505ced23623d83187bf1e5cd1593fa5b1213f2e3fa18568
MD5 fba2513e42a9a1e57052edd25b6266ed
BLAKE2b-256 01c390062bfdd19f4f9bb7cef3d7106910afc0996b6e5f0566f3d346da517046

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