Skip to main content

Crunch-UML

Crunch_UML is a parser for XMI files originating from UML tools such as Enterprise Architect. The tool reads the XMI and stores entities and relationships in an SQLite database for further analysis or use.

Crunch_UML is stillunder heavy development and does not have any releases.

Build Status Coverage Status PyPi Licence

  • Parses entities such as Package, Class, and Relation from an XMI file.
  • Uses SQLAlchemy for database access and manipulation.
  • Imports different input formats
  • Saves all imported data to SQLAlchemy database
  • Supports Upserts to be able to import different datasets, changes to datasets etc.
  • Exports to different output formats: Excel, JSON, CSV, Jinja2 templating, Markdown

Install

  1. Download the repository and goto root directory
  2. Install packages from requirements.txt

Usage

cli.py [-h] [-v] [-d] [-db_url DATABASE_URL] {import,export} ...

General Options:

  • -h, --help: Show this help message and exit.
  • -v, --verbose: Set log level to INFO.
  • -d, --debug: Set log level to DEBUG.
  • -db_url DATABASE_URL, --database_url DATABASE_URL: URL of the crunch_uml database. Supports any SQLAlchemy (https://docs.sqlalchemy.org/en/20/dialects/) compatible database. The default is sqlite:///crunch_uml.db.

Commands:

  • import: Import data to the Crunch UML database.

    • -h, --help: Show this help message and exit.
    • -db_create, --database_create_new: Create a new database and discard the existing one.
    • -f INPUTFILE, --inputfile INPUTFILE: Path to the XMI file.
    • -t INPUTTYPE, --inputtype INPUTTYPE: Specifies input type from the following: ['xmi', 'eaxmi', 'json', 'xlsx', 'csv'].
    • --skip_xmi_relations: Skip parsing relations for XMI files only.

    Supported Input Types:

    • xmi": XMI Parser for strict XMI files. No extensions, like EA extensions, are parsed. Tested on XMI v2.1 spec.
    • eaxmi": XMI Parser that processes EA (Enterprise Architect) specific extensions. Tested on XMI v2.1 spec.
    • json": Generic parser that reads JSON files and looks for table and column definitions.
    • xlsx": Generic parser that reads Excel files, expecting one or more worksheets that correspond with the names of one or more tables.
    • csv": Generic parser that reads a single CSV file, expecting its name to be in the list of tables.

    The following tables are supported: ['packages', 'classes', 'attributes', 'enumerations', 'enumerationliterals', 'associations', 'generalizations'].

  • export: Export data from the Crunch UML database.

    • -h, --help: Show this help message and exit.
    • -f OUTPUTFILE, --outputfile OUTPUTFILE: Specify the output file.
    • -t OUTPUTTYPE, --outputtype OUTPUTTYPE: Specifies output type from the following: ['jinja2', 'ggm_md', 'json', 'csv', 'xlsx'].
    • -pi OUTPUT_PACKAGE_IDS, --output_package_ids OUTPUT_PACKAGE_IDS: List of package IDs separated by commas.
    • -xpi OUTPUT_EXCLUDE_PACKAGE_IDS, --output_exclude_package_ids OUTPUT_EXCLUDE_PACKAGE_IDS: List of package IDs to be excluded from the output, separated by commas.
    • -jtd OUTPUT_JINJA2_TEMPLATEDIR, --output_jinja2_templatedir OUTPUT_JINJA2_TEMPLATEDIR: Directory for Jinja2 templates.
    • -jt OUTPUT_JINJA2_TEMPLATE, --output_jinja2_template OUTPUT_JINJA2_TEMPLATE: Specific Jinja2 template file.

    Supported Export Types:

    • jinja2": Renderer using Jinja2 to render one file per model in the database, where a model refers to a package with at least one Class. Requires "output_jinja2_template" and "output_jinja2_templatedir".
    • ggm_md": Renderer that produces a basic markdown file per model in the database, where a model refers to a package containing at least one Class.
    • json": Produces a JSON document where each element relates to a table in the data model.
    • csv": Produces multiple CSV files, each corresponding to a table in the data model.
    • xlsx": Produces an Excel sheet with tabs corresponding to tables in the data model.

Development

# Get a comprehensive list of development tools
make help

Future Improvements

  • Expansion to other database backends such as PostgreSQL or MySQL.
  • Export XMI, Turtle (Linked Data)
  • Develop more Jinja2 templates
  • Perform checking
  • Direct access to repositories (import and export)

You can use this foundation and expand upon it as you continue to develop your program and add new features.

Metadata

Release files for crunch-uml 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for crunch-uml 0.1.1
File Size Uploaded Provenance Actions
crunch_uml-0.1.1.tar.gz 2.8 MB Without provenance Details for crunch_uml-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for crunch-uml 0.1.1
File Interpreter ABI Platform Actions
crunch_uml-0.1.1-py3-none-any.whl Python 3 none any Details for crunch_uml-0.1.1-py3-none-any.whl

Total release size: 2.8 MB

Release files / crunch_uml-0.1.1.tar.gz

Download URL crunch_uml-0.1.1.tar.gz
Size 2.8 MB
Tags Source
SHA-256 checksum
How to use checksums
223c0854d0f2a319b722844d9b6ec6ff55df278d8ea84fd7057f863daada4107
BLAKE2b-256 checksum
How to use checksums
a8dffd0de59c088f9e0af09bdec59b1cf1a33bd6d2a9dbd8aed0ef0dd733e875
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / crunch_uml-0.1.1-py3-none-any.whl

Download URL crunch_uml-0.1.1-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
481299ad7246bb771f600a0332a3503b45c0af37cd03b3a605818396eac1fd67
BLAKE2b-256 checksum
How to use checksums
5c9ca217d627ac6c5790a9b71b62c8744c1123f2feb7656cc47e1f0209886916
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Security for crunch-uml 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page