Skip to main content

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.

DirecTracer

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"].

Metadata

Release files for DirecTracer 1.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for DirecTracer 1.0.7
File Size Uploaded
DirecTracer-1.0.7.tar.gz 7.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for DirecTracer 1.0.7
File Interpreter ABI Platform
DirecTracer-1.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 14.1 kB

Release files / DirecTracer-1.0.7.tar.gz

Download URL DirecTracer-1.0.7.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
798109e04c0265edcc64fb3fb73a36208c5629d3c2b4fbea24232c33a90cdb62
BLAKE2b-256 checksum
How to use checksums
620f75b4d29441ffdd493205965b2c7446265d0b47e0a9b1eb07ff2795e194b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.4

Release files / DirecTracer-1.0.7-py3-none-any.whl

Download URL DirecTracer-1.0.7-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e639dafec0a3c115f7a6e97d5beb3d28582b19e15f9ad6d936fa68a33b30ad19
BLAKE2b-256 checksum
How to use checksums
9d7583cfe2d285d8e29efafb22f4edafa5be80b774ef049a16abdfeb9bf0ec1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.4

Release history Release notifications | RSS feed

This release

1.0.7 This release

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page