pytree2 0.1.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pytree2-0.1.4/LICENSE.md +21 -0
- pytree2-0.1.4/PKG-INFO +106 -0
- pytree2-0.1.4/README.md +92 -0
- pytree2-0.1.4/pyproject.toml +27 -0
- pytree2-0.1.4/setup.cfg +4 -0
- pytree2-0.1.4/src/pytree/__init__.py +1 -0
- pytree2-0.1.4/src/pytree/classes/ProgressTracker.py +514 -0
- pytree2-0.1.4/src/pytree/classes/PyTree.py +741 -0
- pytree2-0.1.4/src/pytree/classes/__init__.py +1 -0
- pytree2-0.1.4/src/pytree/main.py +186 -0
- pytree2-0.1.4/src/pytree/utils/__init__.py +1 -0
- pytree2-0.1.4/src/pytree/utils/aux_funcs.py +253 -0
- pytree2-0.1.4/src/pytree/utils/global_vars.py +22 -0
- pytree2-0.1.4/src/pytree2.egg-info/PKG-INFO +106 -0
- pytree2-0.1.4/src/pytree2.egg-info/SOURCES.txt +17 -0
- pytree2-0.1.4/src/pytree2.egg-info/dependency_links.txt +1 -0
- pytree2-0.1.4/src/pytree2.egg-info/entry_points.txt +2 -0
- pytree2-0.1.4/src/pytree2.egg-info/requires.txt +1 -0
- pytree2-0.1.4/src/pytree2.egg-info/top_level.txt +1 -0
pytree2-0.1.4/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Angelo Angonezi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
pytree2-0.1.4/PKG-INFO
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pytree2
|
|
3
|
+
Version: 0.1.4
|
|
4
|
+
Summary: A Python CLI utility for visualizing folder trees with sizes and counts.
|
|
5
|
+
Author-email: Angelo Luiz Angonezi <angeloangonezi2@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/angelo-angonezi/pytree
|
|
8
|
+
Project-URL: Issues, https://github.com/angelo-angonezi/pytree/issues
|
|
9
|
+
Requires-Python: >=3.9
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE.md
|
|
12
|
+
Requires-Dist: treelib
|
|
13
|
+
Dynamic: license-file
|
|
14
|
+
|
|
15
|
+
# pytree
|
|
16
|
+
A Python CLI utility for visualizing folder trees with sizes and counts.
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
pytree requires **Python version 3.9+** in order to run. You can install pytree in your Python environment with the command:
|
|
21
|
+
```shell
|
|
22
|
+
pip install pytree2
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
```shell
|
|
28
|
+
pytree [-h] [-d] [-s] [-c] [-x EXTENSION] [-k KEYWORD] [-l LEVEL] [start_path ...]
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
pytree - a python cli utility for visualizing folder trees with sizes and counts
|
|
33
|
+
|
|
34
|
+
positional arguments:
|
|
35
|
+
start_path defines path to directory to start building the tree
|
|
36
|
+
|
|
37
|
+
optional arguments:
|
|
38
|
+
-h, --help show this help message and exit
|
|
39
|
+
-d, --dirs-only tree displays directories only, and does not show files inside folders
|
|
40
|
+
-s, --show-sizes tree displays files and folder sizes, in mega or gigabytes
|
|
41
|
+
-c, --show-counts tree displays the number of files or folders inside each directory
|
|
42
|
+
-x EXTENSION, --extension EXTENSION
|
|
43
|
+
tree will include only files that match given extension (e.g. ".txt", ".pdf")
|
|
44
|
+
-k KEYWORD, --keyword KEYWORD
|
|
45
|
+
tree will include only files that contain specific keyword on file name
|
|
46
|
+
-l LEVEL, --level LEVEL
|
|
47
|
+
defines tree's depth (until which subfolder tree will be created) [0=start_path, -1=all]
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Examples
|
|
51
|
+
|
|
52
|
+
#### Basic usage
|
|
53
|
+
```shell
|
|
54
|
+
pytree test_folder
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
test_folder
|
|
59
|
+
├── another_folder
|
|
60
|
+
│ ├── empty_folder
|
|
61
|
+
│ └── one_mb_file.txt
|
|
62
|
+
└── folder
|
|
63
|
+
├── a_python_file.py
|
|
64
|
+
├── folder_inside_folder
|
|
65
|
+
│ ├── not_a_text_file.pdf
|
|
66
|
+
│ ├── ten_kb_file.txt
|
|
67
|
+
│ └── two_mb_file.txt
|
|
68
|
+
└── ten_mb_file.txt
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### Using optional arguments
|
|
72
|
+
By concatenating the optional arguments, you can get a clear view of the folder structure.
|
|
73
|
+
Additionally, pytree will print a summary line in the end, with the folder/file count and total size.
|
|
74
|
+
```shell
|
|
75
|
+
pytree test_folder -dcs
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
test_folder [2] (13 mb)
|
|
80
|
+
├── another_folder [2] (1 mb)
|
|
81
|
+
│ └── empty_folder [0] (0 bytes)
|
|
82
|
+
└── folder [3] (12 mb)
|
|
83
|
+
└── folder_inside_folder [3] (2 mb)
|
|
84
|
+
|
|
85
|
+
5 folders, 6 files, 13 mb
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
#### Specifying extension/keyword
|
|
89
|
+
You can also specify a search keyword (by passing **-x** your_extension) or keyword (by passing **-k** your_keyword), e.g:
|
|
90
|
+
```shell
|
|
91
|
+
pytree test_folder -cs -x .pdf
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
test_folder [2] (136 bytes)
|
|
96
|
+
├── another_folder [1] (0 bytes)
|
|
97
|
+
│ └── empty_folder [0] (0 bytes)
|
|
98
|
+
└── folder [1] (136 bytes)
|
|
99
|
+
└── folder_inside_folder [1] (136 bytes)
|
|
100
|
+
└── not_a_text_file.pdf (136 bytes)
|
|
101
|
+
|
|
102
|
+
5 folders, 6 files (1 valid), 136 bytes
|
|
103
|
+
```
|
|
104
|
+
Notice that by using this option together with the **-c** and **-s** flags, the counts and sizes in the final summary
|
|
105
|
+
line will contain a counter for files matching search criteria, and the total size will reflect only matching files,
|
|
106
|
+
providing an easy and quick way of scanning folders and identifying large files of a specified extension/keyword.
|
pytree2-0.1.4/README.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# pytree
|
|
2
|
+
A Python CLI utility for visualizing folder trees with sizes and counts.
|
|
3
|
+
|
|
4
|
+
## Installation
|
|
5
|
+
|
|
6
|
+
pytree requires **Python version 3.9+** in order to run. You can install pytree in your Python environment with the command:
|
|
7
|
+
```shell
|
|
8
|
+
pip install pytree2
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```shell
|
|
14
|
+
pytree [-h] [-d] [-s] [-c] [-x EXTENSION] [-k KEYWORD] [-l LEVEL] [start_path ...]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
pytree - a python cli utility for visualizing folder trees with sizes and counts
|
|
19
|
+
|
|
20
|
+
positional arguments:
|
|
21
|
+
start_path defines path to directory to start building the tree
|
|
22
|
+
|
|
23
|
+
optional arguments:
|
|
24
|
+
-h, --help show this help message and exit
|
|
25
|
+
-d, --dirs-only tree displays directories only, and does not show files inside folders
|
|
26
|
+
-s, --show-sizes tree displays files and folder sizes, in mega or gigabytes
|
|
27
|
+
-c, --show-counts tree displays the number of files or folders inside each directory
|
|
28
|
+
-x EXTENSION, --extension EXTENSION
|
|
29
|
+
tree will include only files that match given extension (e.g. ".txt", ".pdf")
|
|
30
|
+
-k KEYWORD, --keyword KEYWORD
|
|
31
|
+
tree will include only files that contain specific keyword on file name
|
|
32
|
+
-l LEVEL, --level LEVEL
|
|
33
|
+
defines tree's depth (until which subfolder tree will be created) [0=start_path, -1=all]
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Examples
|
|
37
|
+
|
|
38
|
+
#### Basic usage
|
|
39
|
+
```shell
|
|
40
|
+
pytree test_folder
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
test_folder
|
|
45
|
+
├── another_folder
|
|
46
|
+
│ ├── empty_folder
|
|
47
|
+
│ └── one_mb_file.txt
|
|
48
|
+
└── folder
|
|
49
|
+
├── a_python_file.py
|
|
50
|
+
├── folder_inside_folder
|
|
51
|
+
│ ├── not_a_text_file.pdf
|
|
52
|
+
│ ├── ten_kb_file.txt
|
|
53
|
+
│ └── two_mb_file.txt
|
|
54
|
+
└── ten_mb_file.txt
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
#### Using optional arguments
|
|
58
|
+
By concatenating the optional arguments, you can get a clear view of the folder structure.
|
|
59
|
+
Additionally, pytree will print a summary line in the end, with the folder/file count and total size.
|
|
60
|
+
```shell
|
|
61
|
+
pytree test_folder -dcs
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
test_folder [2] (13 mb)
|
|
66
|
+
├── another_folder [2] (1 mb)
|
|
67
|
+
│ └── empty_folder [0] (0 bytes)
|
|
68
|
+
└── folder [3] (12 mb)
|
|
69
|
+
└── folder_inside_folder [3] (2 mb)
|
|
70
|
+
|
|
71
|
+
5 folders, 6 files, 13 mb
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
#### Specifying extension/keyword
|
|
75
|
+
You can also specify a search keyword (by passing **-x** your_extension) or keyword (by passing **-k** your_keyword), e.g:
|
|
76
|
+
```shell
|
|
77
|
+
pytree test_folder -cs -x .pdf
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
test_folder [2] (136 bytes)
|
|
82
|
+
├── another_folder [1] (0 bytes)
|
|
83
|
+
│ └── empty_folder [0] (0 bytes)
|
|
84
|
+
└── folder [1] (136 bytes)
|
|
85
|
+
└── folder_inside_folder [1] (136 bytes)
|
|
86
|
+
└── not_a_text_file.pdf (136 bytes)
|
|
87
|
+
|
|
88
|
+
5 folders, 6 files (1 valid), 136 bytes
|
|
89
|
+
```
|
|
90
|
+
Notice that by using this option together with the **-c** and **-s** flags, the counts and sizes in the final summary
|
|
91
|
+
line will contain a counter for files matching search criteria, and the total size will reflect only matching files,
|
|
92
|
+
providing an easy and quick way of scanning folders and identifying large files of a specified extension/keyword.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=73", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "pytree2"
|
|
7
|
+
version = "0.1.4"
|
|
8
|
+
description = "A Python CLI utility for visualizing folder trees with sizes and counts."
|
|
9
|
+
authors = [{name = "Angelo Luiz Angonezi", email = "angeloangonezi2@gmail.com"}]
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE.md"]
|
|
13
|
+
requires-python = ">=3.9"
|
|
14
|
+
dependencies = ["treelib"]
|
|
15
|
+
|
|
16
|
+
[project.urls]
|
|
17
|
+
Homepage = "https://github.com/angelo-angonezi/pytree"
|
|
18
|
+
Issues = "https://github.com/angelo-angonezi/pytree/issues"
|
|
19
|
+
|
|
20
|
+
[project.scripts]
|
|
21
|
+
pytree = "pytree.main:main"
|
|
22
|
+
|
|
23
|
+
[tool.setuptools]
|
|
24
|
+
package-dir = {"" = "src"}
|
|
25
|
+
|
|
26
|
+
[tool.setuptools.packages.find]
|
|
27
|
+
where = ["src"]
|
pytree2-0.1.4/setup.cfg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# pytree/__init__.py
|