Create Sequence Diagrams Using seqdiag
October 1, 2014
Have you ever needed to create sequence diagrams? If you’re like me you constantly have to. Up to now I have always used a manual process using pen/paper or Visio. But I wanted an easier way and found seqdiag.
I installed it in a virtualenv on Ubuntu 14.04.
codeghar@host~$ virtualenv --system-site-packages virt
I used --system-site-packages
because seqdiag relies on Python Imaging Library (PIL). Of course, make sure you have python-pil package installed in your OS. I ran into this problem (About the PIL Error — IOError: decoder zip not available) when I didn’t use --system-site-packages
. The impression I got was it’s hard to get PIL installed in a virtualenv and easier to just use the system-wide PIL.
codeghar@host~$ source virt/bin/activate
(virt)codeghar@host~$ pip install seqdiag
To create a diagram you need to provide a dialog in a .diag file. You can look at the sample diagrams for more information. The following will create a new file (or overwrite an existing file) called example.png.
(virt)codeghar@host~$ seqdiag -Tpng --no-transparency example.diag
Hat tip to generate uml sequence diagrams with python or perl for bringing seqdiag to my attention.
Recent Comments