Tools for turning Python code into XMI?

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


Hello,

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

- pyreverse (now included with Pylint):
  http://www.logilab.org/857

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

- Umbrello:
  http://uml.sourceforge.net/

  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:
  http://gaphor.sourceforge.net/

  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? :)

Stefan



More information about the Python-list mailing list