Generates a database from a set of *.xcm (executable class model) files
Project description
Make an Executable UML Repository
This is the first step in the model execution tool chain.
The make-xuml-repo command generates an empty metamodel database that can be populated with the modeled
components of your system.
We say 'metamodel' because the generated database schema defines the Shlaer-Mellor Executable UML modeling language. It defines all structures necessary to describe platform independent domains, class models, state models, as well as the complete computational activities driven by each state transition and method call.
Output
The output consists of these three files:
mmdb.ral-- The databasemmdb.txt-- Human readable text that displays all of the database tables (relvars / relational variables)mmclass_nt.py-- A set of python named tuples, one per metamodel class, used for model population. Each metamodel class corresponds to a similarly named relvar (table).
Input
The input to make-xuml-repo is a set of *.xcm (Executable Class Model) files. The files are parsed using
the xcm-parser. You can view these files here: <TBD>
This file set defines a subset of the full modeling language though the bulk of the language is, in fact, supported.
But work continues and, as the .xcm files upgrade, it will be necessary to refresh your metamodel database
by re-running make-xuml-repo.
The latest Shlaer-Mellor metamodel is specified inside this package as a folder of .xcm (executable class model) files and a types.yaml file.
Each subsystem of the metamodel (class-attribute, state, etc) is defined in a single .xcm file all within
a single foler. That folder also contains one types.yaml file specifying the db type (data type) to use for each
metamodel attribute type. The db type 'string', for example, is associated with the State Name metamodel type.
Database
Rather than a traditional SQL database, we use Andrew Mangogna's open source tclRAL Relational Algebra Library.
It is an implementation of relational algebra as defined by C.J. Date and Hugh Darwen. So we can use nested relational algrebra without any of that SQL mess. It is implemented in C and Tcl, but we provide a python front end called PyRAL to keep everything pythonic.
Why you need this
You probably don't. What you want instead is the metamodel populator which does use this package. It's not up on PyPI yet. Give me a couple of weeks and it should be here. I'll post a link when it's ready.
Though if you did want to fiddle with the metamodel, generate your own variation of it and such, this package might come in handy.
Installation
Create or activate a Python 3.11+ environment (earlier versions may or may not work), then install from PyPI:
% pip install make-xuml-repo
It's a good idea to upgrade pip first if you haven't in a while:
% pip install --upgrade pip
Once installed, you can invoke the repository generator with the makexumlrepo command.
Usage
Run the command in the directory where you want the output files created:
% makexumlrepo
This generates three files in the current directory:
mmdb.ral— The database. Although it is a text file, it can be opened by TclRAL (via PyRAL) to establish an empty relvar (table) per metamodel class, ready to be populated with instances of your modeled domains.mmdb.txt— A human readable listing of every relvar in the database.mmclass_nt.py— A set of Python named tuples, one per metamodel class, with a field for each of that class's attributes. PyRAL uses these to insert one or more tuples into the corresponding relvar.
You can load these with the metamodel populator (coming soon) or your own tooling. In my own workflow I generate the files and copy them into my metamodel populator package.
Command line options
| Option | Long form | Description |
|---|---|---|
-h |
--help |
Show a summary of all options and exit. |
-V |
--version |
Print the installed version and exit. |
-M |
--models |
Copy the packaged metamodel and layout directories into the current directory, then exit. Existing directories are left untouched (a warning is issued). No database is built. |
-v |
--verbose |
Show warnings on the console. By default warnings are suppressed on the console (but still recorded in the log file when -L is used). |
-L |
--log |
Keep the diagnostic make_xuml_repo.log file. Without this flag the log is removed on exit. |
-D |
--debug |
Run in debug mode. |
Inspecting or customizing the metamodel
If you want to look at the .xcm metamodel files or the layout sheets that ship with the package, copy
them into your working directory with:
% makexumlrepo -M
This creates a metamodel directory (the .xcm files and mm_types.yaml) and a layout directory in
the current directory. No database is generated when -M is supplied.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file make_xuml_repo-1.0.0.tar.gz.
File metadata
- Download URL: make_xuml_repo-1.0.0.tar.gz
- Upload date:
- Size: 1.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afeda17c815952199377ab3e1f965210fb4d1adc63f843789f6f05e93d8fa938
|
|
| MD5 |
caba040f5713e10c3a952169acd04e5a
|
|
| BLAKE2b-256 |
35fa74fa117af5ba884ad89f90ad5309d6d6179671cc33e7f39523f29b867f76
|
File details
Details for the file make_xuml_repo-1.0.0-py3-none-any.whl.
File metadata
- Download URL: make_xuml_repo-1.0.0-py3-none-any.whl
- Upload date:
- Size: 1.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3445eaec4391d18b6549f1831bee8dc0a9c8bcee5589d15cb30776a90b32b1d
|
|
| MD5 |
78306bab796ca441ada248002dc6979e
|
|
| BLAKE2b-256 |
f6ec71524877ffe4ba697f68506ebbb423a2dab2136e86e00e64d6f8de01cb54
|