python source code conversion to uml diagram with Sparx Systems Enterprise Architect
Please let me know how to create a uml diagram along with its equivalent documentation for the source code(.py format) using enterprise 开发者_高级运维architecture 7.5
Please help me find the solution, I have read the solution for the question on this website related to my topic but in vain
- File / New Project / enter your project name.
- In the Project Browser, create a package named "source"
- Right-click the source package, "Code Engineering", "Import Source Directory".
- Pick the directory containing your module(s) as the "Root Directory"
- Set "Source Type" to Python
- Enable "Recursively Process Subdirectories"
- Select "Package Per File"
- Click "OK".
I don't know about any direct solution, but some existing tools might help you in the process. The Eric Python IDE supports generating class diagrams from Python code, for example.
- Go to project browser
- Create a model
- Right-click model > Add > Add View > Class
- Right-click class > Code Engineering > Import Source Directory...
- Check "one package per folder"
The last one ensures you'll have an interesting diagram full of classes.
The best and easy way to generate the class diagram for python script is to use the Pycharm IDE.
- Step 1: Create a package for python script (Alt+Insert→Python Package)
- Step 2: Right click on the created package file and select the option diagrams
- Step 3: After selecting diagrams option you can select the option at top to add method
More info: https://confluence.jetbrains.com/display/PYH/Working+with+UML+class+diagrams+in+PyCharm
精彩评论