Tools for turning Python code into XMI?

Stefan Schwarzer sschwarzer at
Sun Oct 24 11:22:25 CEST 2010


I'm looking for a tool which can read Python files and write
a corresponding XMI file for import into UML tools.

Ideally, the conversion tool should:

- be open source or freeware

- be available for Linux

- be a command line tool

- allow to specify exactly the Python files that should to
  be taken into account

- include operations, together with their parameters

- include attributes (in the UML sense) if possible (I know
  this isn't reliable)

Here are some programs I found via PyPI or search engine and
tried so far. All of them miss something I'd really like to

- pyreverse (now included with Pylint):

  I think this has the most potential. You can specify the
  files to import on the command line. There are many output
  formats for the information from the Python code, but XMI
  doesn't seem to be included. There are a few formats that
  could be parsed and turned into XMI (plain, plain-ext).
  Unfortunately, pyreverse doesn't include the parameters of

- Umbrello:

  Umbrello is a graphical KDE tool. You can specify either
  single files or whole directories including
  subdirectories. In my case, one of the subdirectories is
  for unit tests, which clutters the UML model. Attributes
  (again, in the UML sense) are seemingly not considered but
  operations. The parameters and return values of the latter,
  however, are all output as of type "string".

- Gaphor:

  Gaphor is a GUI tool allowing to specify the files one by
  one which might be ok for a few files but surely
  becomes tedious if there are some more. The generated
  diagram, which can be exported to XMI, lacks the
  parameters of the operations.

Do you have any other suggestions for programs I should have
a look at? Does someone even has written such a tool and has
not published it yet? :)


More information about the Python-list mailing list