tedivm / paracelsus

Visualize SQLAlchemy Databases using Mermaid or Dot Diagrams.
https://pypi.org/project/paracelsus/
MIT License
91 stars 9 forks source link

Allow for calling `inject` directly, without Typer #22

Open jacobeatsspam opened 2 months ago

jacobeatsspam commented 2 months ago
    inject(Path("models/README.md"))
paracelsus/cli.py", line 181, in inject
    format=format.value,
           ^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'value'

The issue is that the default uses Formats.mermaid.value and then again, .value is attempted to be used below.

If I can propose a fix, set the default to the correct type, Formats.mermaid.

tedivm commented 1 month ago

Pushing it to .value is a direct work around for another bug, where if you reference the field itself then the help documentation ends up being wrong.

Is your goal to allow the function to be called without the typer interface? As in, you want to programmatically call those functions?

jacobeatsspam commented 1 month ago

Is your goal to allow the function to be called without the typer interface? As in, you want to programmatically call those functions?

Bingo. And I arrived at this need because #21