Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/loglux/tree_builder
https://github.com/loglux/tree_builder
Last synced: 16 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/loglux/tree_builder
- Owner: loglux
- Created: 2024-03-13T00:26:06.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-03-13T00:26:29.000Z (11 months ago)
- Last Synced: 2024-03-13T02:32:43.863Z (11 months ago)
- Language: Python
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tree Builder
Tree Builder is a Python script that generates a text-based visualisation of your directory structure and represents it in a tree format. It scans the directory of your choice and prints a tree structure, representing your files and directories. This tool can be handy for Windows users, since the built-in tree command does not allow exclusions.
## Features
- Scans and presents a directory structure in a clear tree format.
- Option to ignore certain directories.
- Option to include files in the tree structure or to only display directories.## Usage
First, define a list of directories you want to ignore. These could be directories that are unrelated to your project's structure.
```python
ignore = ['__pycache__', '.git', '.idea', '.venv']
```
Next, create a new instance of the `DirectoryTree` class. Pass in the directory you want to start from as well as the list of directories to ignore.
```python
start_path = '.' # The directory to start from
```
Folders only
```python
tree.display()
```
Folders and files
```python
tree.display(True)
```
Example:
```bash
python tree_builder.py
```