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:
-
Install the library using pip:
pip install the-directory-scanner -
Import the
scan_directoryfunction from the library and use it to scan a directory:from the_directory_scanner import scan_directory scan_result = scan_directory(directory=".", output_file_name="directory_structure.txt", ignored_items=('.git', '.idea', 'venv', '__pycache__',))
-
Access the generated directory structure in the output file (
directory_structure.txtin this example) to view the results. -
If you wish to modify the structure, import
prettify_structurefunction and provide the path to generated file: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:
Metadata
Release files for the-directory-scanner 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| the-directory-scanner-1.0.tar.gz | 3.9 kB | Without provenance | Details for the-directory-scanner-1.0.tar.gz |
Release files / the-directory-scanner-1.0.tar.gz
| Download URL | the-directory-scanner-1.0.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f27ef029a7d8ddeecb11d9006e383951fe9dc6417ce51bece6dcd1b0b8eeee7b
|
|
BLAKE2b-256 checksum How to use checksums |
6022483e5e4522733c3cc65c9fbaedbc77845418fe66eb3e1956c553fcfea764
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Security for the-directory-scanner 1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.