Installing ArgoUML-Python for python code generation from UML

I've been looking into ways to generate python code from UML. I tried Enterprise Architect from Sparx systems, which is indeed an impressive product, but since the code generation lacked features I wished for anyway, I thought looking into the open source alternatives might be worth it.

I tried some UML tools like Umbrello, Gaphor, StarUML etc but they all were either not mature enough, or had problems running on Linux or Linux/Wine.

I finally settled on ArgoUML, which feels mature enough. And there is the ArgoUML-python plugin, for python code generation (see also this question on StackOverflow, for a background to my choice). Unfortunately there is no binaries available for download, so you have to build them yourself. That was not much of a hassle at all in Eclipse though, so I'll go through the steps here:

Create the source directories for both argouml, and argouml-python. I have:

  /home/samuel/src/argouml
  /home/samuel/src/argouml-python

  • In the first one, do:

 svn co http://argouml.tigris.org/svn/argouml/trunk . --username guest

(leave the password blank).
  • ... and in the second folder:

 svn co http://argouml-python.tigris.org/svn/argouml-python/trunk . --username guest

(password blank here as well).
  • Open up Eclipse, in a new workspace.
  • Right click in the main file navigator
  • Choose "Import"
  • Choose "General > Import existing projects ..."
  • Select the source folder for /home/samuel/src/argouml
  • Do the same for the argouml-python folder
  • Let the workspace finalize the building process in the background (make sure you have turned automatic building "on" in "Project > Build Automatically".
  • Right click the build.xml in the argo-uml project and click "Run as > Ant task..." (Note the three dots!)
  • Check the box at the "jar" line (right under the "compile" one).
  • Run
  • Mark the argo-uml project in the navigator and click F5 to refresh the file tree. You will now see a directory named "build", where the argouml-python.jar" file is located.
  • Open that "build" directory in your file browser, and copy it into the "ext" folder in your argouml program directory.
  • Fire up ArgoUML
  • Done!