Skip to main content

🎨 RenderSchema

Automatically generate beautiful documentation diagrams from Python code

PyPI version Python Version License: MIT Code style: black


✨ Features

  • 🚀 Zero-Config Diagram Generation - Turn Python classes into UML diagrams with one line of code
  • 🎨 Beautiful by Default - Clean, modern diagrams with Tailwind-inspired color schemes
  • 🌓 Light & Dark Themes - Perfect for documentation in any style
  • 📊 Multiple Diagram Types - UML class diagrams, flowcharts, and class relationships
  • 🖼️ Multiple Export Formats - SVG, PNG, PDF, and interactive HTML
  • 🔍 Interactive HTML - Zoomable, pannable diagrams for web documentation
  • 🎯 Type-Safe - Full type hints for excellent IDE support
  • 📦 Framework Integration - Works seamlessly with Sphinx, MkDocs, and more

🎯 Why RenderSchema?

Developers love diagrams but hate making them. RenderSchema solves this by automatically generating clean, professional diagrams from your Python code. No more manual diagramming tools or outdated documentation!

📦 Installation

# Basic installation
pip install renderschema

# With PNG/PDF export support
pip install renderschema[image]

# Full installation (all features)
pip install renderschema[all]

🚀 Quick Start

Generate a UML Diagram

from renderschema import diagram

class Person:
    def __init__(self, name: str, age: int):
        self.name = name
        self.age = age
    
    def greet(self) -> str:
        return f"Hello, I'm {self.name}!"

# Generate diagram - it's that simple!
diagram(Person).export("person.svg")

Create a Flowchart

from renderschema import diagram

def calculate_discount(price: float, customer_type: str) -> float:
    if customer_type == "vip":
        return price * 0.8
    elif customer_type == "premium":
        return price * 0.9
    else:
        return price

diagram(calculate_discount, diagram_type="flowchart").export("discount.svg")

Visualize Class Relationships

from renderschema import diagram

class Animal:
    pass

class Dog(Animal):
    def bark(self): pass

class Cat(Animal):
    def meow(self): pass

diagram([Animal, Dog, Cat], diagram_type="class").export("animals.svg")

🎨 Themes

RenderSchema supports both light and dark themes:

# Light theme (default)
diagram(MyClass, theme="light").export("light.svg")

# Dark theme - perfect for dark mode documentation
diagram(MyClass, theme="dark").export("dark.svg")

📤 Export Formats

Export to multiple formats based on your needs:

# SVG - vector graphics, perfect for web and scaling
diagram(MyClass).export("output.svg")

# PNG - raster image (requires cairosvg)
diagram(MyClass).export("output.png")

# PDF - for print documentation (requires cairosvg)
diagram(MyClass).export("output.pdf")

# Interactive HTML - zoomable and pannable
diagram(MyClass).export("output.html")

💡 Advanced Usage

Get Diagrams as Strings

# Get SVG markup as string
svg_content = diagram(MyClass).to_svg()

# Get interactive HTML as string
html_content = diagram(MyClass).to_html(interactive=True)

Analyze Before Generating

generator = diagram(MyClass)
data = generator.analyze()  # Get structured data about the class
svg = generator.generate()   # Generate the diagram

Custom Options

# Customize diagram generation
diagram(
    MyClass,
    theme="dark",
    color_scheme="tailwind"
).export("custom.svg")

📚 Documentation

🛠️ Development

Setup Development Environment

# Clone the repository
git clone https://github.com/juliuspleunes4/RenderSchema.git
cd RenderSchema

# Install with development dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Format code
black renderschema/ tests/

# Lint code
ruff check renderschema/ tests/

# Type check
mypy renderschema/

Running Examples

cd examples
python basic_uml.py
python flowchart_example.py
python class_relationships.py

🤝 Contributing

Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.

Important: All changes must be documented in docs/CHANGELOG.md. Never create separate .md files to explain changes.

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🎯 Roadmap

  • More diagram types (sequence diagrams, state machines)
  • Custom styling and color schemes
  • Advanced layout algorithms
  • Integration with popular documentation tools
  • Module and package-level diagrams
  • Real-time diagram preview in editors

🙏 Acknowledgments

Built with ❤️ by Julius Pleunes

Inspired by the need for effortless, beautiful diagram generation for Python developers.


⬆ back to top

Made with ❤️ for the Python community

Release files for renderschema 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for renderschema 0.1.2
File Size Uploaded
renderschema-0.1.2.tar.gz 37.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for renderschema 0.1.2
File Interpreter ABI Platform
renderschema-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 55.6 kB

Release files / renderschema-0.1.2.tar.gz

Download URL renderschema-0.1.2.tar.gz
Size 37.5 kB
Tags Source
SHA-256 checksum
How to use checksums
13d9ab2c77bbf75bcc3662d3ef78255bf430f94abfb998251409ea4a4c6b3b90
BLAKE2b-256 checksum
How to use checksums
cebc6f1199064df296444c433341820c2bbb89d4a829185e775d71cbe35891e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release files / renderschema-0.1.2-py3-none-any.whl

Download URL renderschema-0.1.2-py3-none-any.whl
Size 18.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd0e60581976ff61607477bf555c680eb0a2f24c6a4e4a636c95996a4db56c81
BLAKE2b-256 checksum
How to use checksums
63edbfb12938a271f7892b752f7d326da36e2a97c1cdf12f647e46e1bd251137
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page