semvec/pypi-packages huggingface dataset:
pytree2 0.2.4
A Python CLI utility for visualizing folder trees with sizes and counts.
Requires Python: >=3.8
Keywords: python, cli, tree, folder structure, file size, disk usage

# pytree
A Python CLI utility for visualizing folder trees with sizes and counts.

## Installation

pytree requires **Python version 3.8+** in order to run. You can install pytree in your Python environment with the command:
```shell
pip install pytree2
```

## Usage

```shell
pytree [-h] [-d] [-s] [-c] [-x EXTENSION] [-k KEYWORD] [-l LEVEL] [start_path ...]
```

```
pytree - a python cli utility for visualizing folder trees with sizes and counts

positional arguments:
  start_path            defines path to directory to start building the tree

optional arguments:
  -h, --help            show this help message and exit
  -d, --dirs-only       tree displays directories only, and does not show files inside folders
  -s, --show-sizes      tree displays files and folder sizes, in mega or gigabytes
  -c, --show-counts     tree displays the number of files or folders inside each directory
  -x EXTENSION, --extension EXTENSION
                        tree will include only files that match given extension (e.g. ".txt", ".pdf")
  -k KEYWORD, --keyword KEYWORD
                        tree will include only files that contain specific keyword on file name
  -l LEVEL, --level LEVEL
                        defines tree's depth (until which subfolder tree will be created) [0=start_path, -1=all]
```

### Examples

#### Basic usage
```shell
pytree test_folder
```

```
test_folder
├── another_folder
│   ├── empty_folder
│   └── one_mb_file.txt
└── folder
    ├── a_python_file.py
    ├── folder_inside_folder
    │   ├── not_a_text_file.pdf
    │   ├── ten_kb_file.txt
    │   └── two_mb_file.txt
    └── ten_mb_file.txt
```

#### Using optional arguments
By concatenating the optional arguments, you can get a clear view of the folder structure.
Additionally, pytree will print a summary line in the end, with the folder/file count and total size.
```shell
pytree test_folder -dcs
```

```
test_folder [2] (13 mb)
├── another_folder [2] (1 mb)
│   └── empty_folder [0] (0 bytes)
└── folder [3] (12 mb)
    └── folder_inside_folder [3] (2 mb)

5 folders, 6 files, 13 mb
```

#### Specifying extension/keyword
You can also specify a search keyword (by passing **-x** your_extension) or keyword (by passing **-k** your_keyword), e.g:
```shell
pytree test_folder -cs -x .pdf
```

```
test_folder [2] (136 bytes)
├── another_folder [1] (0 bytes)
│   └── empty_folder [0] (0 bytes)
└── folder [1] (136 bytes)
    └── folder_inside_folder [1] (136 bytes)
        └── not_a_text_file.pdf (136 bytes)

5 folders, 6 files (1 valid), 136 bytes
```
Notice that by using this option together with the **-c** and **-s** flags, the counts and sizes in the final summary
line will contain a counter for files matching search criteria, and the total size will reflect only matching files,
providing an easy and quick way of scanning folders and identifying large files of a specified extension/keyword.
af-worklist-manager 6.0.5
AristaFlow BPM WorklistManager/WorklistManager REST Client
Keywords: Swagger, AristaFlowREST/WorklistManager

AristaFlow BPM REST Client library for connecting to the WorklistManager/WorklistManager endpoint. https://pypi.org/project/aristaflowpy/ provides APIs on top of the AristaFlow BPM REST endpoints for many use cases, so using aristaflowpy is recommended.
af-remote-html-runtime-manager 5.0.5
AristaFlow BPM RuntimeManager/RemoteHTMLRuntimeManager REST Client
Keywords: Swagger, AristaFlowREST/RuntimeManager

AristaFlow BPM REST Client library for connecting to the RuntimeManager/RemoteHTMLRuntimeManager endpoint. https://pypi.org/project/aristaflowpy/ provides APIs on top of the AristaFlow BPM REST endpoints for many use cases, so using aristaflowpy is recommended.
af-licence-manager 3.0.5
AristaFlow BPM LicenceManager/LicenceManager REST Client
Keywords: Swagger, AristaFlowREST/LicenceManager

AristaFlow BPM REST Client library for connecting to the LicenceManager/LicenceManager endpoint. https://pypi.org/project/aristaflowpy/ provides APIs on top of the AristaFlow BPM REST endpoints for many use cases, so using aristaflowpy is recommended.
af-process-image-renderer 4.0.5
AristaFlow BPM ProcessImageRenderer/ProcessImageRenderer REST Client
Keywords: Swagger, AristaFlowREST/ProcessImageRenderer

AristaFlow BPM REST Client library for connecting to the ProcessImageRenderer/ProcessImageRenderer endpoint. https://pypi.org/project/aristaflowpy/ provides APIs on top of the AristaFlow BPM REST endpoints for many use cases, so using aristaflowpy is recommended.
af-res-model-manager 4.0.5
AristaFlow BPM ResModelManager/ResModelManager REST Client
Keywords: Swagger, AristaFlowREST/ResModelManager

AristaFlow BPM REST Client library for connecting to the ResModelManager/ResModelManager endpoint. https://pypi.org/project/aristaflowpy/ provides APIs on top of the AristaFlow BPM REST endpoints for many use cases, so using aristaflowpy is recommended.
af-simple-process-image-renderer 3.0.5
AristaFlow BPM SimpleProcessImageRenderer/SimpleProcessImageRenderer REST Client
Keywords: Swagger, AristaFlowREST/SimpleProcessImageRenderer

AristaFlow BPM REST Client library for connecting to the SimpleProcessImageRenderer/SimpleProcessImageRenderer endpoint. https://pypi.org/project/aristaflowpy/ provides APIs on top of the AristaFlow BPM REST endpoints for many use cases, so using aristaflowpy is recommended.
af-execution-manager 6.0.5
AristaFlow BPM ExecutionManager/ExecutionManager REST Client
Keywords: Swagger, AristaFlowREST/ExecutionManager

AristaFlow BPM REST Client library for connecting to the ExecutionManager/ExecutionManager endpoint. https://pypi.org/project/aristaflowpy/ provides APIs on top of the AristaFlow BPM REST endpoints for many use cases, so using aristaflowpy is recommended.
af-process-manager 5.0.5
AristaFlow BPM ProcessManager/ProcessManager REST Client
Keywords: Swagger, AristaFlowREST/ProcessManager

AristaFlow BPM REST Client library for connecting to the ProcessManager/ProcessManager endpoint. https://pypi.org/project/aristaflowpy/ provides APIs on top of the AristaFlow BPM REST endpoints for many use cases, so using aristaflowpy is recommended.
af-runtime-service 5.0.5
AristaFlow BPM RuntimeService/RuntimeService REST Client
Keywords: Swagger, AristaFlowREST/RuntimeService

AristaFlow BPM REST Client library for connecting to the RuntimeService/RuntimeService endpoint. https://pypi.org/project/aristaflowpy/ provides APIs on top of the AristaFlow BPM REST endpoints for many use cases, so using aristaflowpy is recommended.
af-org-model-manager 5.1.5
AristaFlow BPM OrgModelManager/OrgModelManager REST Client
Keywords: Swagger, AristaFlowREST/OrgModelManager

AristaFlow BPM REST Client library for connecting to the OrgModelManager/OrgModelManager endpoint. https://pypi.org/project/aristaflowpy/ provides APIs on top of the AristaFlow BPM REST endpoints for many use cases, so using aristaflowpy is recommended.