Registry / data / plantuml

plantuml

JSON →
library0.3.0pypypiunverified

The `plantuml` Python library provides a client to generate PlantUML diagrams from Python code. It can interact with a local PlantUML JAR file (requiring Java) or a remote PlantUML server (including the public one). The current version is 0.3.0, with updates occurring infrequently but the project is actively maintained for compatibility and minor enhancements.

pip install plantuml
INSTALL
IMPORT
SIG · PLANTUML
P
plantuml
datapythonv0.3.0
Install
1.7s avg
Import
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.1MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.7s · import 0.000s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PlantUML
from plantuml import PlantUML
import plantuml

This quickstart demonstrates how to initialize the PlantUML client and generate a basic PNG diagram using the default public PlantUML server. The generated image data is then saved to a file.

from plantuml import PlantUML # Initialize PlantUML client. # By default, it uses the public server: http://www.plantuml.com/plantuml # For a local server, provide the jar_path or custom url: # pu = PlantUML(jar_path='/path/to/plantuml.jar') # pu = PlantUML(url='http://localhost:8080/plantuml') pu = PlantUML() # Uses the default public server puml_code = """ @startuml Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response Alice -> Bob: Another authentication Request Alice <-- Bob: Another authentication Response @enduml """ try: # Generate the diagram image data (PNG by default) image_data = pu.processes(puml_code) # Define the output filename output_filename = "quickstart_diagram.png" # Save the image data to a file with open(output_filename, "wb") as f: f.write(image_data) print(f"Successfully generated PlantUML diagram to {output_filename}") except Exception as e: print(f"An error occurred during diagram generation: {e}") print("Please ensure you have an internet connection if using the default server,") print("or that your local PlantUML setup (Java + JAR) is correct.")
Debug
Known issues
gotchaLocal diagram generation (using `jar_path`) requires Java to be installed and accessible in your system's PATH, as well as a downloaded PlantUML JAR file.
fix
Ensure Java is installed (`java -version`) and `jar_path` points to a valid PlantUML.jar file. Alternatively, use remote generation by specifying a `url` or relying on the default public server.
affects: All
gotchaThe default remote server `http://www.plantuml.com/plantuml` might be subject to rate limits, uptime issues, or network restrictions.
fix
For production or high-volume usage, consider hosting your own PlantUML server and providing its URL to the `PlantUML` constructor: `PlantUML(url='http://your-server:8080/plantuml')`.
affects: All
gotchaWhen using a custom `url` for a remote server, ensure the URL is correct and the PlantUML server is running and accessible from where your Python script is executed.
fix
Verify the `url` parameter. Test connectivity to the PlantUML server URL directly (e.g., in a browser or using `curl`). Ensure no firewalls are blocking the connection.
affects: All
Upgrade
Version history
0.3.0latest on PyPI · released Nov 1, 2019
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
8
Amazon
1
Resources
plantuml — pip install plantuml · libregistry