DirTree
O DirTree é uma ferramenta com interface gráfica (GUI) construída em Python utilizando a biblioteca PyQt5 para gerar representações visuais de árvores de diretórios. É extremamente útil para documentar a estrutura de projetos em arquivos README.md ou para análises rápidas de sistemas de arquivos, tudo através de uma interface amigável.
DirTree is a graphical user interface (GUI) tool built in Python using the PyQt5 library to generate visual representations of directory trees. It is extremely useful for documenting project structures in README.md files or for quick file system analysis, all through a user-friendly interface.
Como funcionaHow it works
Através de uma interface intuitiva, o usuário pode selecionar o diretório raiz que deseja mapear e configurar opções visuais, como quais pastas ou arquivos ignorar (por exemplo, node_modules, .git ou __pycache__). O aplicativo percorre os diretórios recursivamente e desenha a hierarquia utilizando caracteres ASCII/Unicode, permitindo copiar o resultado diretamente para a área de transferência.
Through an intuitive interface, the user can select the root directory to map and configure visual options, such as which folders or files to ignore (e.g., node_modules, .git, or __pycache__). The application recursively traverses directories and draws the hierarchy using ASCII/Unicode characters, allowing the result to be copied directly to the clipboard.
Exemplo de UsoUsage Example
Para iniciar a interface gráfica, basta instalar as dependências e executar o script principal: To launch the graphical interface, simply install the dependencies and run the main script:
$ pip install -r requirements.txt $ python main_app.py
A partir daí, a janela do PyQt5 será aberta, e toda a interação é feita através de botões e campos de seleção. A saída gerada será semelhante a esta: From there, the PyQt5 window will open, and all interaction is done through buttons and selection fields. The generated output will look similar to this:
meu-projeto/ ├── main.py ├── interface/ │ ├── window.ui │ └── styles.qss └── README.md
MotivaçãoMotivation
Desenvolvi este projeto para aprofundar meus conhecimentos no desenvolvimento de interfaces gráficas desktop em Python com PyQt5, além de praticar a manipulação de caminhos de arquivos com as bibliotecas nativas do Python. O resultado foi uma ferramenta que eu mesmo utilizo para documentar meus repositórios. I developed this project to deepen my knowledge in desktop graphical interface development in Python with PyQt5, as well as to practice file path manipulation with native Python libraries. The result was a tool that I use myself to document my repositories.