CLI help documentation¶
To view the CLI help documentation, run:
erdantic --help
# or
python -m erdantic --help
Usage: erdantic [OPTIONS] {models_or_modules}...
Draw entity relationship diagrams (ERDs) for Python data model classes.
Diagrams are rendered using the Graphviz library. Currently supported data
modeling frameworks are Pydantic, attrs, and standard library dataclasses.
╭─ Arguments ──────────────────────────────────────────────────────────────────╮
│ * models_or_modules <str> One or more full dotted paths for data │
│ model classes, or modules containing data │
│ model classes, to include in diagram, │
│ e.g., 'erdantic.examples.pydantic.Party'. │
│ Only the root models of composition trees │
│ are needed; erdantic will traverse the │
│ composition tree to find component │
│ classes. │
│ [required] │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ * --out -o <path> Output filename. │
│ [required] │
│ --terminal-model -t <str> Full dotted paths for │
│ data model classes to │
│ set as terminal nodes │
│ in the diagram. │
│ erdantic will stop │
│ searching for │
│ component classes │
│ when it reaches these │
│ models. Repeat this │
│ option if more than │
│ one. │
│ --terminus <str> Deprecated. Use │
│ --terminal-model │
│ instead. │
│ --limit-search-mode… -m <pydantic|pydantic_v Plugin identifiers. │
│ 1|attrs|dataclasses| If any are specified, │
│ msgspec> when searching a │
│ module, limit data │
│ model classes to │
│ those ones. Repeat │
│ this option if more │
│ than one. Defaults to │
│ None which will find │
│ data model classes │
│ matching any active │
│ plugin. │
│ --dot -d Print out Graphviz │
│ DOT language │
│ representation for │
│ generated graph to │
│ console instead of │
│ rendering an image. │
│ The --out option will │
│ be ignored. │
│ --d2 Print out D2 language │
│ representation to │
│ console instead of │
│ rendering an image. │
│ The --out option will │
│ be ignored. │
│ --no-overwrite Prevent overwriting │
│ an existing file. │
│ --quiet -q <int> Use to decrease log │
│ verbosity. Can use │
│ multiple times. │
│ --verbose -v <int> Use to increase log │
│ verbosity. Can use │
│ multiple times. │
│ --list-plugins List active plugins │
│ and exit. │
│ --version Show erdantic version │
│ and exit. │
│ --install-completion Install completion │
│ for the current │
│ shell. │
│ --show-completion Show completion for │
│ the current shell, to │
│ copy it or customize │
│ the installation. │
│ --help Show this message and │
│ exit. │
╰──────────────────────────────────────────────────────────────────────────────╯