Metadata-Version: 2.4
Name: llm-draw
Version: 0.1.2
Summary: LLM diagram generation library for Mermaid, PlantUML, and draw.io style workflows.
Project-URL: Homepage, https://github.com/lead-engineer/llm-draw
Project-URL: Repository, https://github.com/lead-engineer/llm-draw
Project-URL: Issues, https://github.com/lead-engineer/llm-draw/issues
Author: llm-draw contributors
License: MIT License
        
        Copyright (c) 2026 llm-draw contributors
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: agents,diagrams,drawio,llm,mermaid,plantuml
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Documentation
Requires-Python: >=3.9
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Provides-Extra: examples
Requires-Dist: python-dotenv>=1.0; extra == 'examples'
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.2; extra == 'langchain'
Requires-Dist: langchain-openai>=0.1; extra == 'langchain'
Provides-Extra: openai
Requires-Dist: openai>=1.0; extra == 'openai'
Provides-Extra: publish
Requires-Dist: build>=1.2; extra == 'publish'
Requires-Dist: twine>=5.0; extra == 'publish'
Description-Content-Type: text/markdown

# llm-draw

[![PyPI version](https://img.shields.io/badge/PyPI-0.1.1-blue)](https://pypi.org/project/llm-draw/)
![Python versions](https://img.shields.io/badge/Python-%3E%3D3.9-blue)

Generate diagram source from natural-language prompts using LLMs.

`llm-draw` infers the diagram type and output format from your prompt, then
returns Mermaid, PlantUML, draw.io XML, or Markdown diagram text.

## Install

Install from PyPI:

```bash
python -m pip install "llm-draw[openai]"
```

Other extras are available for specific integrations:

```bash
python -m pip install "llm-draw[langchain]"
```

## Example

```python
import os

from llm_draw import LlmDraw

client = LlmDraw(provider="openai")
result = client.generate(
    prompt="Show a web app with browser, API, PostgreSQL, Redis, and Stripe.",
    apikey=os.environ["OPENAI_API_KEY"],
    model_id="gpt-4.1-mini",
)

print(result.content)
print(result.diagram_type, result.output_format)
```

## CLI

```bash
export OPENAI_API_KEY="..."

llm-draw \
  "Draw a payment workflow with fraud checks and refund handling" \
  --model-id gpt-4.1-mini \
  --output workflow.mmd
```

`llm-draw` writes inferred metadata to stderr and writes diagram source to
stdout, unless `--output` is provided.

## Supported Diagrams

- Architecture, system architecture, network, AWS, Azure, GCP, Kubernetes, Terraform
- Flowchart, process flow, workflow, process map, BPMN, swimlane, state, sequence
- ERD, UML, use case, block, data flow, user flow, user journey map, org chart
- Mermaid editor and PlantUML editor modes

