{ "info": { "author": "Stefan Urbanek", "author_email": "stefan.urbanek@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5" ], "description": "# Entigen\n\n_Meta-model entity generator_\n\nGenerator that takes an entity-relationship-like model as input and generates\nvarious blocks of source files that either describe the model in the target\nlanguage or perform some functionality with the structures of the model.\n\nThe tool's goals are:\n\n* Reduce boilerplate while maintaining transparency\n* Reduce points where error might be manually introduced\n* Respect multiple languages and preserve type consistency\n\nExample uses: class definition, initialization methods, comparators, database\nstorage/retrieval operations, protocol specifications, documentation, etc.\n\nThis tool is to be used when language magic is not desired and when transparent\ncode and ability to diagnose is prefered. Examples of language magic: Python\nmetaclasses, synthesized properties and methods.\n\n\n## Requirements\n\nThe `entigen` tool requires Python >= 3.6\n\n\n## Usage\n\n\tusage: entigen [-h] [-b BLOCK_TYPE] [-f READER] [-t WRITER] [-V VARIABLES]\n\t\t\t\t model [entities [entities ...]]\n\n\tProcess some integers.\n\n\tpositional arguments:\n\t model Model source\n\t entities Entities to be included\n\n\toptional arguments:\n\t -h, --help show this help message and exit\n\t -b BLOCK_TYPE, --block BLOCK_TYPE\n\t\t\t\t\t\t\tBlock type the writer writes\n\t -f READER, --from READER\n\t\t\t\t\t\t\tMetamodel input format\n\t -t WRITER, --to WRITER\n\t\t\t\t\t\t\tText output format\n\t -V VARIABLES, --variable VARIABLES\n\t\t\t\t\t\t\tText output format\n\n\nExample: go to the `examples` directory and run:\n\n entigen thing.model > thing.py\n\nThen see the generated `thing.py` file.\n\n## Writers and Blocks\n\nThe following writers are available:\n\n* `python` \u2013 Python source file or snippet writer\n* `info` \u2013 Text output writer\n\n\n### Python Writer\n\nThe Python writer writes type-annotated Python 3.6 source code. Blocks:\n\n* `class` \u2013 class with instance variable annotations and the\n `__init__` and `__eq__` method\n* `class_file` \u2013 file with classes of specified entities\n\n`__init__` \u2013 method takes one argument per entity property and then assigns\nit to the corresponding instance variable. If a variable is composite, such as\nlist, and has a default value, then the default value is assigned within the\nmethod, not in the argument list.\n\n`__eq__` \u2013 method takes other object, then compares whether the other object is\nof the same subclass as the entity. All properties of the entity are compared\nwith the properties of the other entity.\n\n\n### Info Writer\n\nThe `info` writer can be used by shell scripts to learn more about the moden\nand the have better control over overal output generation using other writers.\n\nTo list names of all entities in a model, one per line, use:\n\n entigen -w info model\n\nVariables:\n\n* `decamelize` \u2013 write entity names as lower-case identifiers\n\n\n## Readers\n\nThe default reader is a `csv` reader. The meta-model is a directory with CSV\nfiles describing meta-model entities. Files:\n\n* `properties.csv` \u2013 list of entity properties. Fields: category, entity, name,\n type, optional, tag, label, description\n* `entities.csv` \u2013 list of entities.\n\nThe main reason for the CSV input format is that it is structured and can be\nedited as text or as a spreadsheet. Spreadsheet applications are wide-spread\nenough and they have quite comfortable user interface for editing structured\ndata.\n\n\n## Data Types\n\nThe generator comes with it's own very simple data types. The variety of types\nis intentionally limited so we are able to cover wide variety of outputs with\neasy type and type handling translation.\n\nThe base types are:\n\n* `string`\n* `int`\n* `identifier` - internally same as string, but writers can implement checks\n for content beign valid identifier\n\nThe complex types are:\n\n* `list` - list of base-type objects\n\n\n### Special default values\n\nThe following special values should be compared as whole strings for their\ncorresponding types.\n\n* `[]` is a special default value for a string meaning an empty list\n\n\n# Development\n\nSome things to keep in mind while working on this tool:\n\n* The generated source should be as human-readable as possible, it should be\n nicely formatted and not far from how a person with a good style would\n write it.\n* When adding a core data type its availability or convertibility to other\n languages (programming or modelling) should be strongly considered.\n\n# Author and License\n\nAuthor: Stefan Urbanek stefan.urbanek@gmail.com\n\nLicense: MIT\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "entigen", "package_url": "https://pypi.org/project/entigen/", "platform": "", "project_url": "https://pypi.org/project/entigen/", "project_urls": null, "release_url": "https://pypi.org/project/entigen/0.1.2/", "requires_dist": null, "requires_python": "", "summary": "Metamodel entity generator", "version": "0.1.2" }, "last_serial": 2668579, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "f4d2947d01d88b30f45547fb4d89de07", "sha256": "be58132650ae46fa5546681aa9c45f605461ea44dac8a8592029ed7d7d220af4" }, "downloads": -1, "filename": "entigen-0.1.1.tar.gz", "has_sig": false, "md5_digest": "f4d2947d01d88b30f45547fb4d89de07", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10343, "upload_time": "2017-02-23T06:18:04", "url": "https://files.pythonhosted.org/packages/59/1b/377b277e2822abf18f9feacdc25a99575d300e4ac1d00e767bb190be40c7/entigen-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "5fb3f9651f56f5907681b189b7a04634", "sha256": "56d3c0abd991b19c572eded614bed7dbaf381fbcb88a830a9d913492b4db2765" }, "downloads": -1, "filename": "entigen-0.1.2.tar.gz", "has_sig": false, "md5_digest": "5fb3f9651f56f5907681b189b7a04634", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11369, "upload_time": "2017-02-26T07:38:39", "url": "https://files.pythonhosted.org/packages/92/34/dd012144e3dcdccc25bd29d33b3cc430191a1acf54316eb9016048c9bfe5/entigen-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5fb3f9651f56f5907681b189b7a04634", "sha256": "56d3c0abd991b19c572eded614bed7dbaf381fbcb88a830a9d913492b4db2765" }, "downloads": -1, "filename": "entigen-0.1.2.tar.gz", "has_sig": false, "md5_digest": "5fb3f9651f56f5907681b189b7a04634", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11369, "upload_time": "2017-02-26T07:38:39", "url": "https://files.pythonhosted.org/packages/92/34/dd012144e3dcdccc25bd29d33b3cc430191a1acf54316eb9016048c9bfe5/entigen-0.1.2.tar.gz" } ] }