I have this code repo
I created manual UML which look like this:

I am trying to auto generate the UML via pyreverse:
pyreverse -o png -p ShoppingCart ./mainService.py
Format png is not supported natively. Pyreverse will try to generate it using Graphviz...
Unfortunately, it gives me blank diagram. What can I do to get the project's classes in the diagram?
This is the file structure:
.
├── Entity
│ ├── Apple.py
│ ├── Buy1Get1FreeApple.py
│ ├── Buy3OnPriceOf2Orange.py
│ ├── Offer.py
│ ├── Orange.py
│ ├── Product.py
│ └── ShoppingCart.py
├── Enum
│ └── ProductType.py
└── mainService.py
In short
Assuming the installation of pyreverse and graphviz is correct, all you need to do is to package your project adding some emplty __init__py files in each folder. Alternatively, you'd hjhave to add all the modules manually in the command line.
More details - step by step
About the error message
Assuming everything is installed correctly, your command line should give you the warning message, which is absolutely normal:
What's wrong?
The diagram will stay empty because you tell pyreverse to analyse a single file and there is no class defined in that file. If you'd add manually the different modules to be analysed:
you would then very well obtain a rudimentary diagram:
If you would add the options
-ASupfront you'd get all ancestors in the project and all associated classes recursively:How to package your project?
This is cumbersome. Fortunately, there's little missing to package your project. For a full reference, you may look here. But in short, it is sufficient to add an empty
__init__.pyfile in your project folder, and each subfolder where you store the modules:You will then be able to run the simpler command line:
and obtain this magnificient diagram:
The packaging helps python and pyreverse to understand that these are not files to be analysed in isolation, but in the context of a package made of subpackages, etc.