# 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](https://pypi.org/project/DirecTracer/).
## 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](./demo/thumbnail2.png)](https://youtu.be/FqMauKiTvVs?si=FJlBiQBwpZb7_IPm)
## Usage
Install the DirecTracer package using the following command:
```bash
pip install DirecTracer
```
OR
Clone this repository using the following command:
```bash
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.
```python
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`](./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"].
Raw data
{
"_id": null,
"home_page": "https://github.com/Hardvan/DirecTracer",
"name": "DirecTracer",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "directory structure, visualization, folder hierarchy, file organization",
"author": "Hardik Pawar",
"author_email": "hardikpawarh@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/62/0f/75b4d29441ffdd493205965b2c7446265d0b47e0a9b1eb07ff2795e194b4/DirecTracer-1.0.7.tar.gz",
"platform": null,
"description": "# DirecTracer\r\n\r\nDirecTracer 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.\r\n\r\n## DirecTracer on PyPI\r\n\r\nView the DirecTracer package on PyPI by clicking [here](https://pypi.org/project/DirecTracer/).\r\n\r\n## Features\r\n\r\n- `save_directory_structure()` function:\r\n\r\n - Generates a directory structure in text and Markdown formats.\r\n - Supports ignoring specific directories and file extensions.\r\n - Outputs clickable links in the Markdown file for easy navigation.\r\n - Text & loading animations while generating the directory structure.\r\n\r\n- `generate_markdown_table()` function:\r\n\r\n - Generates a Markdown table from the given directory structure.\r\n - Includes columns of Serial Number and clickable links to the files through the file names.\r\n\r\n## Demonstration Video\r\n\r\nClick on the thumbnail below to watch the demonstration video on YouTube.\r\n\r\n[![DirecTracer](./demo/thumbnail2.png)](https://youtu.be/FqMauKiTvVs?si=FJlBiQBwpZb7_IPm)\r\n\r\n## Usage\r\n\r\nInstall the DirecTracer package using the following command:\r\n\r\n```bash\r\npip install DirecTracer\r\n```\r\n\r\nOR\r\n\r\nClone this repository using the following command:\r\n\r\n```bash\r\ngit clone https://github.com/Hardvan/DirecTracer\r\ncd DirecTracer\r\npip install .\r\n```\r\n\r\nCall the `save_directory_structure` function from the `DirecTracer` module to generate the directory structure.\r\n\r\n```python\r\nfrom DirecTracer import save_directory_structure\r\nimport os\r\n\r\n\r\n# Generate the directory structure in text and Markdown formats\r\nsave_directory_structure(\r\n root_dir=os.getcwd(),\r\n text_output_file=\"directory_structure.txt\",\r\n markdown_output_file=\"directory_structure.md\",\r\n animation=True\r\n)\r\n```\r\n\r\nView the [`run.py`](./run.py) file for a complete example.\r\n\r\nThe `save_directory_structure()` function accepts the following parameters:\r\n\r\n- **root_dir (str):** The root directory to start scanning from. Defaults to the current working directory.\r\n- **text_output_file (str):** The name of the text output file. Defaults to \"directory_structure.txt\".\r\n- **markdown_output_file (str):** The name of the Markdown output file. Defaults to \"directory_structure.md\".\r\n- **ignored_directories (list, optional):** List of directories to ignore. Defaults to [\".git\", \".vscode\", \"venv\", \".venv\", \".idea\", \"out\"].\r\n- **ignored_extensions (list, optional):** List of file extensions to ignore. Defaults to [\".exe\"].\r\n- **animation (bool, optional):** Enable/Disable the loading animation. Defaults to False.\r\n\r\nThe `generate_markdown_table()` function accepts the following parameters:\r\n\r\n- **root_dir (str)**: The root directory to start scanning from. Defaults to the current working directory.\r\n- **markdown_output_file (str)**: The name of the Markdown output file. Defaults to \"markdown_table.md\".\r\n- **animation (bool, optional)**: Enable/Disable the loading animation. Defaults to False.\r\n- **ignored_extensions (list, optional)**: List of file extensions to ignore. Defaults to [\".exe\"].\r\n\r\n\r\n",
"bugtrack_url": null,
"license": null,
"summary": "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.",
"version": "1.0.7",
"project_urls": {
"Homepage": "https://github.com/Hardvan/DirecTracer"
},
"split_keywords": [
"directory structure",
" visualization",
" folder hierarchy",
" file organization"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9d7583cfe2d285d8e29efafb22f4edafa5be80b774ef049a16abdfeb9bf0ec1c",
"md5": "908b932a74890e52e9a896b7c1ff4423",
"sha256": "e639dafec0a3c115f7a6e97d5beb3d28582b19e15f9ad6d936fa68a33b30ad19"
},
"downloads": -1,
"filename": "DirecTracer-1.0.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "908b932a74890e52e9a896b7c1ff4423",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 7039,
"upload_time": "2024-09-09T12:02:24",
"upload_time_iso_8601": "2024-09-09T12:02:24.068237Z",
"url": "https://files.pythonhosted.org/packages/9d/75/83cfe2d285d8e29efafb22f4edafa5be80b774ef049a16abdfeb9bf0ec1c/DirecTracer-1.0.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "620f75b4d29441ffdd493205965b2c7446265d0b47e0a9b1eb07ff2795e194b4",
"md5": "ca9c7b46f56e939d4f65364d49b1630b",
"sha256": "798109e04c0265edcc64fb3fb73a36208c5629d3c2b4fbea24232c33a90cdb62"
},
"downloads": -1,
"filename": "DirecTracer-1.0.7.tar.gz",
"has_sig": false,
"md5_digest": "ca9c7b46f56e939d4f65364d49b1630b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 7015,
"upload_time": "2024-09-09T12:02:26",
"upload_time_iso_8601": "2024-09-09T12:02:26.086238Z",
"url": "https://files.pythonhosted.org/packages/62/0f/75b4d29441ffdd493205965b2c7446265d0b47e0a9b1eb07ff2795e194b4/DirecTracer-1.0.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-09 12:02:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Hardvan",
"github_project": "DirecTracer",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "directracer"
}