the directory scanner
V 1.0.2 Stable
디렉토리 스캐너는 디렉토리 구조를 스캔하고 포괄적 인 파일 및 폴더 목록을 생성하는 프로세스를 단순화하도록 설계된 파이썬 라이브러리입니다. 이는 사용자가 지정한 특정 파일 및 폴더를 무시하고 디렉토리를 재귀 적으로 통과하는 편리한 방법을 제공합니다.

PIP를 사용하여 라이브러리를 설치하십시오.
pip install the-directory-scanner
라이브러리에서 scan_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__' ,)) 결과를 보려면 출력 파일 (이 예제의 directory_structure.txt )에서 생성 된 디렉토리 구조에 액세스하십시오.
구조를 수정하려면 prettify_structure 함수를 가져 와서 생성 된 파일의 경로를 제공하십시오.
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 ) 출력 예제 directory_structure.txt :
directory_structure.txt
LICENSE.rst
README.md
setup.py
usage.py
directory_scanner/
directory_structure.txt
main.py
__init__.py
디렉토리 스캐너 라이브러리는 유연하고 사용하기 쉬운 인터페이스를 제공하여 디렉토리 스캔 작업을 단순화하는 것을 목표로합니다. 문서화, 분석 또는 기타 목적을위한 디렉토리 구조를 생성 해야하는 경우이 라이브러리는 편리한 솔루션을 제공합니다.