Package which adds a PlantUML cell magic to IPython.
Project description
What is it?
This Python package defines a PlantUML cell magic for IPython. It lets you generate UML diagrams as inline SVG in your notebook. I’ll add embellishments as needed. But, for now, I just needed something that worked and existed as a package (in pypi).
I based my code on Steven Burke’s plantuml gist.
Installation
First, install IPlantuml with pip.
pip install iplantuml
Then, install plantuml. On Debian based system you can install plantuml package. Otherwise you can download plantuml.jar and copy it to /usr/local/bin/plantuml.jar.
sudo apt install plantuml
Alternatively you can set a custom path for plantuml.jar during installation
git clone https://github.com/jbn/IPlantUML.git
cd IPlantUML
python setup.py install iplantuml --jarpath /my/custom/path/plantuml.jar
Usage
In Ipython, first,
import iplantuml
then, create a cell like,
%%plantuml @startuml Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response @enduml
The output will be the generated SVG UML diagram.
By default, the magic removes the intermediate (tmp.uml) and target (tmp.svg) files. However, if you enter a name in the %%plantuml line, it retains both files of $name.uml and $name.svg. For example,
%%plantuml auth @startuml Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response @enduml
generates and retains auth.uml and auth.svg.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file IPlantUML-0.1.1.tar.gz
.
File metadata
- Download URL: IPlantUML-0.1.1.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f86df712b6697f6d7499976af5c5a8572517a79c377b2ce0894951923223c5c |
|
MD5 | 198b30c84d65388a60787664c43df52a |
|
BLAKE2b-256 | 10b94db9b9ce81184d1d67f82284ca6131258b32f3f69376ee88aab5f7ff60a4 |