DirecTracer is a Python script that generates a directory structure in both text and Markdown formats. It can be used to visualize the hierarchy of folders and files in a given directory, while also excluding specific folders and file extensions.
Project description
DirecTracer
DirecTracer is a Python script that generates a directory structure in both text and Markdown formats. It can be used to visualize the hierarchy of folders and files in a given directory, while also excluding specific folders and file extensions.
DirecTracer on PyPI
View the DirecTracer package on PyPI by clicking here.
Features
-
save_directory_structure()
function:- Generates a directory structure in text and Markdown formats.
- Supports ignoring specific directories and file extensions.
- Outputs clickable links in the Markdown file for easy navigation.
- Text & loading animations while generating the directory structure.
-
generate_markdown_table()
function:- Generates a Markdown table from the given directory structure.
- Includes columns of Serial Number and clickable links to the files through the file names.
Demonstration Video
Click on the thumbnail below to watch the demonstration video on YouTube.
Usage
Install the DirecTracer package using the following command:
pip install DirecTracer
OR
Clone this repository using the following command:
git clone https://github.com/Hardvan/DirecTracer
cd DirecTracer
pip install .
Call the save_directory_structure
function from the DirecTracer
module to generate the directory structure.
from DirecTracer import save_directory_structure
import os
# Generate the directory structure in text and Markdown formats
save_directory_structure(
root_dir=os.getcwd(),
text_output_file="directory_structure.txt",
markdown_output_file="directory_structure.md",
animation=True
)
View the run.py
file for a complete example.
The save_directory_structure()
function accepts the following parameters:
- root_dir (str): The root directory to start scanning from. Defaults to the current working directory.
- text_output_file (str): The name of the text output file. Defaults to "directory_structure.txt".
- markdown_output_file (str): The name of the Markdown output file. Defaults to "directory_structure.md".
- ignored_directories (list, optional): List of directories to ignore. Defaults to [".git", ".vscode", "venv", ".venv", ".idea", "out"].
- ignored_extensions (list, optional): List of file extensions to ignore. Defaults to [".exe"].
- animation (bool, optional): Enable/Disable the loading animation. Defaults to False.
The generate_markdown_table()
function accepts the following parameters:
- root_dir (str): The root directory to start scanning from. Defaults to the current working directory.
- markdown_output_file (str): The name of the Markdown output file. Defaults to "markdown_table.md".
- animation (bool, optional): Enable/Disable the loading animation. Defaults to False.
- ignored_extensions (list, optional): List of file extensions to ignore. Defaults to [".exe"].
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file DirecTracer-1.0.5.tar.gz
.
File metadata
- Download URL: DirecTracer-1.0.5.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd79514302761cf978f1b03d7e49a2450b88672a3ae8b8335252f779a9ea94a0 |
|
MD5 | f1dc8cce9ae7ec5347c362ea665518e4 |
|
BLAKE2b-256 | 7cb67b888b7d4b91e38d5589e85bba1d685944848745fed7c0e5ecbe338528e6 |
File details
Details for the file DirecTracer-1.0.5-py3-none-any.whl
.
File metadata
- Download URL: DirecTracer-1.0.5-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e2a6a7f2516b14a7d1cc6f6f525dd0da0f2c671bba8ca1e35d011ac6cf97cdd |
|
MD5 | 5703a9ff2882e2f5231a8e3c090c2784 |
|
BLAKE2b-256 | 8aa9b573bf69f58a6fb6b263ce60f1de08ac721d8773110ba4b0733aa9b05c39 |