Codeable Models API documentation¶
Codeable Models is a Python API for programmatically creating del akin to UML or EMF del. The goal of the module is to provide a lightweight codeable modeling API. The module is used as a foundation for working programmatically with del.
Typical use case for Codeable Models are:
Create del textually and be able to use textual tools such as search & replace, copy & paste, grep, and so on to edit them.
Ease model creation and manipulation through code - provided in Python scripts with little to no boilerplate code.
Using Python code to ensure model consistency, perform constraint checking, perform analyses, and calculate metrics.
Create domain del in your code and use them at runtime in your Python project, e.g. to realize a portion of the software system to reflect the domain model in a very literal way as envisaged in Domain-driven Design (DDD).
Generate visual representations of those del such as UML diagrams and tables, e.g. used to support understanding the big picture and communicating the model.
Generate other textual representations, such as Markdown or Latex texts.
Generate code and/or configuration scripts from the del.
Import it with:
import codeable_models
or import its classes and functions, e.g.:
from codeable_models import CClass, CMetaclass, CBundle, CException, CStereotype, add_links
Classes¶
The Codeable Models API offers of a number of classes and functions, each documented in a single section below. The main class hierarchy of Codeable Models is shown in the figures below.

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Simple class to designate bundles as layers, and manage sub-/super-layer relations. |
|
|
|
|
|
CNamedElement is the superclass for all named elements in Codeable Models, such as CClass, CObject, and so on. |
|
|
|
Simple class to designate bundles as packages. |
|
|
Functions¶
|
Function used to add multiple links at once, maybe to different source objects. |
|
Sets multiple links by first deleting all existing links on the objects to be used in the links and then adding the links in the |
|
Function used to delete multiple links, maybe to different source objects. |