Metadata-Version: 2.1
Name: uml_django
Version: 0.0.1
Summary: A UML Generator for Django and Django Rest Framework projects
Home-page: https://github.com/Pedro-V8/uml-django
Author: Pedro Vieira
Author-email: pedrophdv8@outlook.com
License: MIT
Project-URL: Código fonte, https://github.com/Pedro-V8/uml-django
Project-URL: Download, https://github.com/Pedro-V8/uml-django/archive/0.0.1.zip
Keywords: generator converter convert UML Django Rest Framework
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: Portuguese (Brazilian)
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Internationalization
Classifier: Topic :: Scientific/Engineering :: Physics
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: django
Requires-Dist: plantuml
Requires-Dist: six

# Django UML Generator

Uml-Django is a library that aims to convert project models into a UML diagram, indicating their attributes, methods and the relationships of all entities.

## How it Works

From a file created at the root of the project (this is an important step that will be demonstrated below), it will be necessary to create an instance of the Library Class, passing the path to the project's "settings.py" file as a parameter.

With this configuration duly performed and executing the created file, an inspection will be carried out throughout the project in search of all the models of the apps present. Once identified, their attributes, methods, and their relationships with other models, if any, will be saved.

After that, a png file named "class diagram.png" will be created (also in the project root) with a simple class diagram of all classes of the identified models.

## Installation and Usage

Before starting the installation, below are important guidelines to ensure the proper functioning of the application.

- Make sure that python and pip are properly updated, in the current release the library was created with python Python 3.9.6 and Pip 21.2.4. Be with equal or higher versions.

- Install in the same environment as the project's dependencies, for example with the python virtual environment activated (venv), so that the inspection is effective.


1.  Start by downloading the "django_uml" dependency via pip

```
pip3 install uml-django
```

2. Create a .py file at the root of the project (this step is important), below is an example of a simple project and the extension file called "inspect_class.py"

```
.
â”œâ”€â”€ db.sqlite3
â”œâ”€â”€ django_project/
â”‚Â Â  â”œâ”€â”€ __init__.py
â”‚Â Â  â”œâ”€â”€ asgi.py
â”‚Â Â  â”œâ”€â”€ settings.py
â”‚Â Â  â”œâ”€â”€ urls.py
â”‚Â Â  â””â”€â”€ wsgi.py
â”œâ”€â”€ manage.py
â”œâ”€â”€ app_01/
â”œâ”€â”€ app_02/
â””â”€â”€ app_03/
â”œâ”€â”€ requirements.txt
â”œâ”€â”€ inspect_class.py <---
â”œâ”€â”€ venv

```
- The project has 3 apps and the "django_project" directory where the configuration file "settings.py" is located. In addition, the file "inspect_class.py" was added to the root of the project

3. With the file created, just follow the code below, which consists of instantiating an object and parameterizing the path to the project's "settings.py" file, then just call two functions as shown below.

```
from uml_django.inspect import Inspect

inspect_obj = Inspect('django_project.settings')

inspect_obj.inspect()
inspect_obj.create_UML()
```

4. Run the file "inspect_class.py"

```
python3 inspect_class.py
```

After the guidelines, the png file with the diagram will appear in the root of the project with the name "class_diagram.png", containing all the project models synthesized in a class diagram

## Final Considerations
This is an Open-Source project, so you are free to receive suggestions for improvements and enhancements to ensure the quality and viability of the code.
This communication will be very effective if applied in Issues and PR's openings so that the maintainers can discuss and implement new ideas and bug fixes.
