Skip to content

UML Diagram maker overhaul - #79

Merged
PawelPlesniak merged 8 commits into
developfrom
emmuhamm/diagrams-overhaul
Sep 25, 2026
Merged

PawelPlesniak merged 8 commits into
developfrom
emmuhamm/diagrams-overhaul

Conversation

@emmuhamm

@emmuhamm emmuhamm commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

Description

Fixes #72

Added quite a few many things:

  • Support of SVG
  • Automatic coloring of the boxes based on what src/ folders it comes from (--color-by-directory)
    • Color map exists in an ini file
  • Add support for GitHub goodies
    • Add linking to relevant github page (--generate-linkable)
    • (including the actual line number!) (--link-line-number)
    • Auto identifies what commit it was run on
  • Writes temp files to a temp directory instead of the current folder (prevents running on already existing files in the output directory)
  • Fixes a bug where same-name outputs get overwritten (instead these are appended with an increasing number)
  • Fixes a bug where empty names would mess with the output generations (eg .dot)
  • Add an AI-written test? Needs revamping in a future PR

Testing

  • just use all the options and run them on your favorite Python package (must have been installed!)

@emmuhamm emmuhamm self-assigned this Sep 17, 2026
@emmuhamm emmuhamm changed the title Emmuhamm/diagrams overhaul UML Diagram maker overhaul Sep 21, 2026
@emmuhamm
emmuhamm marked this pull request as ready for review September 21, 2026 09:28
@emmuhamm

emmuhamm commented Sep 21, 2026 •

Copy link
Copy Markdown
Member Author

Ready for review, although code's a bit of a mess but it works. I'm going to self review this and defer refactor to the next one.

cc @PawelPlesniak

@PawelPlesniak

Copy link
Copy Markdown
Collaborator

Have startted playing with this, found some issues

  • When pip installing, I needed to add this block to the dependencies
 "graphviz",
 "pylint"
  • When installed, the native tool does not find the directory, is that expected?
((dbt) ) pplesnia@np04-srv-029 ~/nightlyDev/260924/pythoncode/daqpytools (emmuhamm/diagrams-overhaul) $ daqpytools-generate-uml --help
Usage: daqpytools-generate-uml [OPTIONS] [TARGETS]...

  Generate styled UML class diagrams from Python code.

Options:
  -d, --directory DIRECTORY       Working directory to run pyreverse from.
                                  [default: current directory]
  -o, -od, --output-directory DIRECTORY
                                  Output directory for generated diagrams.
                                  [default: pics]
  -f, --format [png|svg|pdf|jpg|none]
                                  Output image format, or 'none' to keep dot
                                  files only. [default: png]
  -c, --concise                   Remove type hints from class attributes and
                                  methods.
  --split / --no-split            Split generated diagrams into connected
                                  components.
  -ms, --min-size INTEGER         Minimum cluster size to render as separate
                                  file. [default: 1]
  -p, --package TEXT              Package(s) to analyze (passed to pyreverse).
  --class TEXT                    Specific class(es) to include (passed to
                                  pyreverse as -c).
  --verbose / --suppress-verbose  Print progress messages.
  --style-config FILE             Path to YAML style config file for the UML
                                  renderer.
  --generate-linkable             Add GitHub source links to nodes and render
                                  a linked SVG.
  --link-line-number              With --generate-linkable, link directly to a
                                  class's definition line.
  --color-by-directory            Color class/package boxes by their top-level
                                  source directory.
  -h, --help                      Show this message and exit.
((dbt) ) pplesnia@np04-srv-029 ~/nightlyDev/260924/pythoncode/daqpytools (emmuhamm/diagrams-overhaul) $ daqpytools-generate-uml -d .
Error: No targets or packages specified.
((dbt) ) pplesnia@np04-srv-029 ~/nightlyDev/260924/pythoncode/daqpytools (emmuhamm/diagrams-overhaul) $ daqpytools-generate-uml 
Error: No targets or packages specified.
((dbt) ) pplesnia@np04-srv-029 ~/nightlyDev/260924/pythoncode/daqpytools (emmuhamm/diagrams-overhaul) $ daqpytools-generate-uml -d daqpyutils -od .
Error: No targets or packages specified.
((dbt) ) pplesnia@np04-srv-029 ~/nightlyDev/260924/pythoncode/daqpytools (emmuhamm/diagrams-overhaul) $ cd ..
((dbt) ) pplesnia@np04-srv-029 ~/nightlyDev/260924/pythoncode $ daqpytools-generate-uml -d daqpyutils -od .
Error: No targets or packages specified.

@PawelPlesniak

Copy link
Copy Markdown
Collaborator

Turns out I was missing the package name

daqpytools-generate-uml daqpytools/drunc/whatever -d .

@PawelPlesniak
PawelPlesniak self-requested a review September 25, 2026 14:49
@PawelPlesniak
PawelPlesniak merged commit 1644694 into develop Sep 25, 2026
3 checks passed
@PawelPlesniak
PawelPlesniak deleted the emmuhamm/diagrams-overhaul branch September 25, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Call graphs!

2 participants