Run VectorLoader Script / Explore-Gitea-Actions (push) Successful in 19s
Details
Gitea Actions For prodir / Explore-Gitea-Actions (push) Successful in 31s
Details
Reviewed-on: #22 |
||
---|---|---|
.gitea/workflows | ||
.vscode | ||
src/prodir | ||
tests | ||
.gitignore | ||
LICENSE | ||
README.md | ||
example.md | ||
example.py | ||
pyproject.toml | ||
pytest.ini | ||
requirements-dev.txt | ||
setup.cfg | ||
setup.py |
README.md
prodir
This is a Python package designed to display and create directory structures in a tree-like format. This tool provides an easy-to-read overview of the directory hierarchy, making it easier for developers to navigate complex project structures and automate the creation of directory layouts from predefined files.
Installation
To install prodir
, you can use pip:
pip install git+https://gitea.fabelous.app/Fabel/prodir.git
Usage
You can run prodir
from the command line. By default, it will analyze the current directory and print its structure in a tree-like format. You can also specify a path to another directory.
To display the directory structure of the current directory:
python -m prodir display
or
prodir
To display the directory structure of a specific directory:
python -m prodir display /path/to/directory
or
python -m prodir /path/to/directory
To create a directory structure from a file:
python -m prodir create /path/to/structure/file.txt -o /output/directory
or
python -m prodir create /path/to/structure/file.txt #will create it in current dir
Options
-v
or--verbose
: Show more detailed output, including information about the path being analyzed.-o
or--output
: Specify the output directory for thecreate
command.
Examples:
python -m prodir display /path/to/directory -v
Important Files and Folders Ignored
By default, prodir
ignores files and folders that start with _
or .
. However, it does include the following exceptions:
__init__.py
and__main__.py
files: These are considered important and will be included in the output.- Special folders like
build
,.git
,node_modules
, etc.: These are also ignored to keep the output focused on the essential parts of the directory structure.
Example Input
my_project/
├── src/
│ ├── __init__.py # init file
│ ├── main.py
│ └── utils.py
├── tests/
│ ├── __init__.py
│ ├── test_main.py
│ └── test_utils.py
├── data/
│ └── sample_data.csv
├── docs/
│ └── README.md
├── .gitignore
├── requirements.txt
└── setup.py
Example Output
Analyzing directory: .\my_project\
data/
└── sample_data.csv
docs/
└── README.md
requirements.txt
setup.py
src/
├── __init__.py
├── main.py
└── utils.py
tests/
├── __init__.py
├── test_main.py
└── test_utils.py
Commands
-
display
: Displays the directory structure of a specified path or the current directory.- Usage:
prodir display [path] [-v]
- Example:
python -m prodir display /path/to/directory
- Usage:
-
create
: Creates a directory structure from a file containing the structure definition.- Usage:
prodir create [file] [output_directory] [-v]
- Example:
python -m prodir create /path/to/structure/file.txt
- Usage: