Package: entigen
# Entigen_Meta-model entity generator_Generator that takes an entity-relationship-like model as input and generatesvarious blocks of source files that either describe the model in the targetlanguage or perform some functionality with the structures of the model.The tool's goals are:* Reduce boilerplate while maintaining transparency* Reduce points where error might be manually introduced* Respect multiple languages and preserve type consistencyExample uses: class definition, initialization methods, comparators, databasestorage/retrieval operations, protocol specifications, documentation, etc.This tool is to be used when language magic is not desired and when transparentcode and ability to diagnose is prefered. Examples of language magic: Pythonmetaclasses, synthesized properties and methods.## RequirementsThe `entigen` tool requires Python >= 3.6## Usageusage: entigen [-h] [-b BLOCK_TYPE] [-f READER] [-t WRITER] [-V VARIABLES]model [entities [entities ...]]Process some integers.positional arguments:model                 Model sourceentities              Entities to be includedoptional arguments:-h, --help            show this help message and exit-b BLOCK_TYPE, --block BLOCK_TYPEBlock type the writer writes-f READER, --from READERMetamodel input format-t WRITER, --to WRITERText output format-V VARIABLES, --variable VARIABLESText output formatExample: go to the `examples` directory and run:entigen thing.model > thing.pyThen see the generated `thing.py` file.## Writers and BlocksThe following writers are available:* `python` – Python source file or snippet writer* `info` – Text output writer### Python WriterThe Python writer writes type-annotated Python 3.6 source code. Blocks:* `class` – class with instance variable annotations and the`__init__` and `__eq__` method* `class_file` – file with classes of specified entities`__init__` – method takes one argument per entity property and then assignsit to the corresponding instance variable. If a variable is composite, such aslist, and has a default value, then the default value is assigned within themethod, not in the argument list.`__eq__` – method takes other object, then compares whether the other object isof the same subclass as the entity. All properties of the entity are comparedwith the properties of the other entity.### Info WriterThe `info` writer can be used by shell scripts to learn more about the modenand the have better control over overal output generation using other writers.To list names of all entities in a model, one per line, use:entigen -w info modelVariables:* `decamelize` – write entity names as lower-case identifiers## ReadersThe default reader is a `csv` reader. The meta-model is a directory with CSVfiles describing meta-model entities. Files:* `properties.csv` – list of entity properties. Fields: category, entity, name,type, optional, tag, label, description* `entities.csv` – list of entities.The main reason for the CSV input format is that it is structured and can beedited as text or as a spreadsheet. Spreadsheet applications are wide-spreadenough and they have quite comfortable user interface for editing structureddata.## Data TypesThe generator comes with it's own very simple data types. The variety of typesis intentionally limited so we are able to cover wide variety of outputs witheasy type and type handling translation.The base types are:* `string`* `int`* `identifier` - internally same as string, but writers can implement checksfor content beign valid identifierThe complex types are:* `list<BASETYPE>` - list of base-type objects### Special default valuesThe following special values should be compared as whole strings for theircorresponding types.* `[]` is a special default value for a string meaning an empty list# DevelopmentSome things to keep in mind while working on this tool:* The generated source should be as human-readable as possible, it should benicely formatted and not far from how a person with a good style wouldwrite it.* When adding a core data type its availability or convertibility to otherlanguages (programming or modelling) should be strongly considered.# Author and LicenseAuthor: Stefan Urbanek stefan.urbanek@gmail.comLicense: MIT