Skip to main content

A converter from PlantUML class diagrams to python3 skeleton classes

supported PlantUML class diagram syntax:

` uml : "@startuml" decls "@enduml" decls : ε | decls decl decl : class | assoc | "skinparam" class : abs "class" id '{' attribs '}' class : abs "interface" id '{' attribs '}' class : enum id '{' ids '}' ids : ID ids : ids ',' ID abs : ε | "abstract" attribs : ε | attribs attrib attrib : prot id vec type init attrib : prot id '(' ')' type attrib : prot id '(' args ')' type attrib : prot "static" id '(' ')' type attrib : prot "static" id '(' args ')' type attrib : prot "abstract" id '(' ')' type attrib : prot "abstract" id '(' args ')' type type : ε | ':' id vec args : id type | args ',' id type prot : ε | '+' | '-' | '~' | '#' vec : ε | '[' ']' | '[' [0-9]+ ']' | '<[_A-Za-z][A-Za-z0-9_]*>' init : ε | '=' id | '=' str | '=' [0-9]+ assoc : id ('<|--' | '<|..' | '--|>' | '..|>') id assoc : id card ('*-->' | '--*' | '<--*' | 'o-->' | 'o--' | '<--o' | '--o' | '-->' | '<--' | '--') card id type card : ε | STR str : '"([^"\\]|\\.)*"' id : '[_A-Za-z][A-Za-z0-9_]*' `

comments start with # symbol and end the end of the line.

A simple class example:

` @startuml skinparam classAttributeIconSize 0 skinparam monochrome true class Tire { - _pressure: int - _standard: int - _flat: bool -- + Tire(standard: int , pressure: int) + standard() : int + pressure() : int + flat() : bool + pressure(pressure: int) : void + empty() : bool } @enduml `

Generate the python3 skeleton code to stdout with:

` python3 -m uml2py tire.uml `

or save the skeleton code to a file:

` python3 -m uml2py tire.uml tire.py `

Use the environment DEBUG=1 for a verbose output:

` DEBUG=1 python3 -m uml2py tire.uml `

Some examples in the examples/ directory.

  1. prs, IST 2024

Metadata

Release files for uml2py 1.0.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 uml2py 1.0.1
File Size Uploaded Provenance
uml2py-1.0.1.tar.gz 6.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for uml2py 1.0.1
File Interpreter ABI Platform
uml2py-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.7 kB

Release files / uml2py-1.0.1.tar.gz

Download URL uml2py-1.0.1.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d1906daa9bf1d2c7ee542ae12ffed2af9a967cc740703e246a595b3d7ceb36f1
BLAKE2b-256 checksum
How to use checksums
6000b049ada6f9a9707cc10b1190238b9b7d4c2afac23d6bcf5720250db66b53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.2

Release files / uml2py-1.0.1-py3-none-any.whl

Download URL uml2py-1.0.1-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5870f6a1457716e8bb25a055caef5e589c017d67fc3f345dbb5b23639e46b10d
BLAKE2b-256 checksum
How to use checksums
7aad160bd01ccd70bdfe0b9cda71062d6b3d58a5dc5417298700f9f5a4371c2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.2

Security for uml2py 1.0.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

1.0.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