https://github.com/a-jean-andreasian/the-directory-scanner
A Python lib which scans the directory structures and generates a comprehensive list of files and folders. It provides a convenient way to recursively traverse directories, ignoring specific files and folders specified by the user.
https://github.com/a-jean-andreasian/the-directory-scanner
developer-tools development pypi-package python repository-management
Last synced: 4 months ago
JSON representation
A Python lib which scans the directory structures and generates a comprehensive list of files and folders. It provides a convenient way to recursively traverse directories, ignoring specific files and folders specified by the user.
- Host: GitHub
- URL: https://github.com/a-jean-andreasian/the-directory-scanner
- Owner: a-jean-andreasian
- License: bsd-3-clause
- Created: 2024-02-07T00:13:01.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-03-22T13:02:01.000Z (about 1 year ago)
- Last Synced: 2026-01-14T09:29:18.079Z (5 months ago)
- Topics: developer-tools, development, pypi-package, python, repository-management
- Language: Python
- Homepage:
- Size: 228 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.rst
Awesome Lists containing this project
README
## The Directory Scanner
The Directory Scanner is a Python library designed to simplify the process of scanning directory structures and generating a comprehensive list of files and folders. It provides a convenient way to recursively traverse directories, ignoring specific files and folders specified by the user.

### Features:
- Recursively scan directories and subdirectories to generate a structured list of files and folders.
- Exclude specific files and folders from the scan using an ignore list.
- Supports customization of the output format to suit different needs.
### Usage:
1. Install the library using pip:
```
pip install the-directory-scanner
```
2. Import the `scan_directory` function from the library and use it to scan a directory:
```python
from the_directory_scanner import scan_directory
scan_result = scan_directory(directory=".", output_file_name="directory_structure.txt",
ignored_items=('.git', '.idea', 'venv', '__pycache__',))
```
3. Access the generated directory structure in the output file (`directory_structure.txt` in this example) to view the results.
4. If you wish to modify the structure, import `prettify_structure` function and provide the path to generated file:
```python
from the_directory_scanner import scan_directory, prettify_structure
scan_result = scan_directory(directory=".", output_file_name="directory_structure.txt",
ignored_items=('.git', '.idea', 'venv', '__pycache__',))
prettify_structure(output_file=scan_result, spaces_to_trim=4, lines_to_trim=1)
```
---
Output example `directory_structure.txt`:
```
directory_structure.txt
LICENSE.rst
README.md
setup.py
usage.py
directory_scanner/
directory_structure.txt
main.py
__init__.py
```
---
### About:
The Directory Scanner library aims to simplify directory scanning tasks by providing a flexible and easy-to-use interface. Whether you need to generate a directory structure for documentation, analysis, or any other purpose, this library offers a convenient solution.
### Links:
- [GitHub Repository](https://github.com/Armen-Jean-Andreasian/the-directory-scanner)
- [PyPI Package](https://pypi.org/project/the-directory-scanner/)
---