开发者

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


  1. File / New Project / enter your project name.
  2. In the Project Browser, create a package named "source"
  3. Right-click the source package, "Code Engineering", "Import Source Directory".
  4. Pick the directory containing your module(s) as the "Root Directory"
  5. Set "Source Type" to Python
  6. Enable "Recursively Process Subdirectories"
  7. Select "Package Per File"
  8. 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜