Create Python Eggs and generate Python Code.
pyegg UML profile overview.
This image shows the diagram of the pyegg profile.
Below, you can find a listing of the stereotypes from this profile, with some information about the diagramm elements they can be applied to, and some information about the relevant tagged values.
|name of stereotype with link to details||applicable to||see link for description|
|UML:Stereotype <<pyegg>>||UML:Package||version, description, authors, email, keywords, url, license, zipsafe, classifiers, copyrights|
|UML:Stereotype <<stub>>||UML:Interface, UML:Class||import|
|UML:Stereotype <<function>>||UML:Class, UML:Operation||args, kwargs|
|UML:Stereotype <<decorator>>||UML:Class, UML:Operation||name, args, kwargs|
Create or point at (reference and import) a complete python egg structure. A pyegg package can be given a dotted name. A split name represents namespace packages. Package directories are located in the src folder of the egg root. A README.txt is created if inexistent. setup.py is created or referenced.
UML-Package is treated as Python package (a directory with an __init_.py)`. Create or point to the directory with package name and create or point at a package’s __init__.py file.
Treat package as python module (i.e. a single python file). Thus create or point at a python file with a package name. All classes in this package are written into the same module as opposed to creating module files for each class in a UML package if marked with the pypackage stereotype.
Indicate class as stub. Used for generalization of 3rd-party objects.
Create a UML:Class somewhere in the model, give it the name of the class or module you want to import, add the <<stub>> stereotype and change the Prpoerty value of import in the properties view under Profile.
Indicate class as API. Will create imports of this class in the package/egg, so it is loaded, when the package is imported from some other module.
Define a python function.
Define a python decorator.
If args and kwargs are omitted in the model, they’re never touched, change them in the generated code as you like.
Set an expression for UML Property. Normally you do not model properties on python level, except they are useful for documentation or semantic reasons. Even if, value is set to None by default. Expression stereotype provides changing this.