Skip to main content

No project description provided

Project description

Pyerd

Pyre - d

Generate ERDs from Pydantic models

Supports Mermaid

Installation

pip install pyerd

Usage

Create a python module that imports all the models you want to generate a diagram for.

Ex. models.py

from models.common import *
from models.donuts import *
from models.plants import *

Import the module and call draw()

from pyerd import draw

# single module
from package.models import donuts
draw(donuts, "output.md")

# multiple models
from package import models

draw(models, "output.md")

Generate Image

For mermaid images you can use the mermaid cli to turn the output of pyerd into an image

npm install -g @mermaid-js/mermaid-cli
mmdc -i output.md -o output.png -t dark -b transparent

Development

ruff check pyerd
pyright pyerd

Tests

poetry run pytest --cov=pyerd tests/

For coverage report

poetry run pytest --cov=pyerd --cov-report html tests/

Future Features

Generate from single class Generate from dataclass class
Generate from SQLModel class
Generate PlantUML diagram for supported classes

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

pyerd-0.2.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyerd-0.2.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file pyerd-0.2.0.tar.gz.

File metadata

  • Download URL: pyerd-0.2.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.6 Darwin/22.6.0

File hashes

Hashes for pyerd-0.2.0.tar.gz
Algorithm Hash digest
SHA256 63dc344912aeadaaf7dbab6dfe145726c79bf2f3ed292beede8d3a04b929b85d
MD5 757f1929aaf5a4c9991f9369bda42752
BLAKE2b-256 7be6e38efb65bb58b55ad7ee43cb78736fa75479492515e0af45744e9c7d8afa

See more details on using hashes here.

File details

Details for the file pyerd-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pyerd-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.6 Darwin/22.6.0

File hashes

Hashes for pyerd-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10ad1713cc92ff6bf1b10f382e86b10126d046cc3017fc1266ed6d94d3bf3a7d
MD5 ca96cf70858ed6ab8972214ba3343fa9
BLAKE2b-256 61ac4434d236935e5e119340bc7dcc50239abaf1f3a9ec9684219986e7a8d8d0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page