## 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 directory-scanner
```
2. Import the `scan_directory` function from the library and use it to scan a directory:
```python
from 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 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/your_username/directory-scanner)
- [PyPI Package](https://pypi.org/project/directory-scanner/)
---
Raw data
{
"_id": null,
"home_page": "https://github.com/Armen-Jean-Andreasian",
"name": "directory-scanner",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "sql-injection,bad input,input validation,security,python",
"author": "Armen-Jean Andreasian",
"author_email": "armen_andreasian@proton.me",
"download_url": "https://files.pythonhosted.org/packages/8f/bf/1e49cb7177520be53ad8ff2142dc94d6e46bcf6d8e241033337ee9358abe/directory_scanner-1.0.tar.gz",
"platform": null,
"description": "## Directory Scanner\r\n\r\nThe 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.\r\n\r\n### Features:\r\n- Recursively scan directories and subdirectories to generate a structured list of files and folders.\r\n- Exclude specific files and folders from the scan using an ignore list.\r\n- Supports customization of the output format to suit different needs.\r\n\r\n### Usage:\r\n1. Install the library using pip:\r\n ```\r\n pip install directory-scanner\r\n ```\r\n\r\n2. Import the `scan_directory` function from the library and use it to scan a directory:\r\n ```python\r\n from directory_scanner import scan_directory\r\n \r\n scan_result = scan_directory(directory=\".\", output_file_name=\"directory_structure.txt\",\r\n ignored_items=('.git', '.idea', 'venv', '__pycache__',))\r\n ```\r\n3. Access the generated directory structure in the output file (`directory_structure.txt` in this example) to view the results.\r\n\r\n4. If you wish to modify the structure, import `prettify_structure` function and provide the path to generated file:\r\n ```python\r\n from directory_scanner import scan_directory, prettify_structure\r\n \r\n scan_result = scan_directory(directory=\".\", output_file_name=\"directory_structure.txt\",\r\n ignored_items=('.git', '.idea', 'venv', '__pycache__',))\r\n \r\n prettify_structure(output_file=scan_result, spaces_to_trim=4, lines_to_trim=1)\r\n ```\r\n \r\n---\r\nOutput example `directory_structure.txt`:\r\n```\r\ndirectory_structure.txt\r\nLICENSE.rst\r\nREADME.md\r\nsetup.py\r\nusage.py\r\ndirectory_scanner/\r\n directory_structure.txt\r\n main.py\r\n __init__.py\r\n```\r\n---\r\n\r\n### About:\r\nThe 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.\r\n\r\n### Links:\r\n- [GitHub Repository](https://github.com/your_username/directory-scanner)\r\n- [PyPI Package](https://pypi.org/project/directory-scanner/)\r\n\r\n---\r\n",
"bugtrack_url": null,
"license": "BSD",
"summary": "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.",
"version": "1.0",
"project_urls": {
"Homepage": "https://github.com/Armen-Jean-Andreasian"
},
"split_keywords": [
"sql-injection",
"bad input",
"input validation",
"security",
"python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8fbf1e49cb7177520be53ad8ff2142dc94d6e46bcf6d8e241033337ee9358abe",
"md5": "751ee60b3bc0bd4a46686cc8c3338fda",
"sha256": "500e38b3d52bddc7bedc7a3928ac1a8469a67464a453574029a41407ff688819"
},
"downloads": -1,
"filename": "directory_scanner-1.0.tar.gz",
"has_sig": false,
"md5_digest": "751ee60b3bc0bd4a46686cc8c3338fda",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 3933,
"upload_time": "2024-02-07T00:04:59",
"upload_time_iso_8601": "2024-02-07T00:04:59.754940Z",
"url": "https://files.pythonhosted.org/packages/8f/bf/1e49cb7177520be53ad8ff2142dc94d6e46bcf6d8e241033337ee9358abe/directory_scanner-1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-07 00:04:59",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "directory-scanner"
}