pyletree 1.0.0__py3-none-any.whl
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.
- pyletree/__init__.py +5 -0
- pyletree/__main__.py +48 -0
- pyletree/cli.py +108 -0
- pyletree/pyletree.py +180 -0
- pyletree-1.0.0.dist-info/METADATA +208 -0
- pyletree-1.0.0.dist-info/RECORD +10 -0
- pyletree-1.0.0.dist-info/WHEEL +5 -0
- pyletree-1.0.0.dist-info/entry_points.txt +2 -0
- pyletree-1.0.0.dist-info/licenses/LICENSE +21 -0
- pyletree-1.0.0.dist-info/top_level.txt +1 -0
pyletree/__init__.py
ADDED
pyletree/__main__.py
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'''Entry point for Pyletree CLI.'''
|
|
2
|
+
|
|
3
|
+
import pathlib
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
from .cli import parse_cmd_line_arguments
|
|
7
|
+
from .pyletree import DirectoryTree
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def main() -> None:
|
|
11
|
+
args = parse_cmd_line_arguments()
|
|
12
|
+
root_dir = pathlib.Path(args.root_dir).resolve()
|
|
13
|
+
|
|
14
|
+
if not root_dir.exists():
|
|
15
|
+
print(f'Error: directory not found: {root_dir}', file=sys.stderr)
|
|
16
|
+
sys.exit(1)
|
|
17
|
+
|
|
18
|
+
if not root_dir.is_dir():
|
|
19
|
+
print(f'Error: path is not a directory: {root_dir}', file=sys.stderr)
|
|
20
|
+
sys.exit(1)
|
|
21
|
+
|
|
22
|
+
try:
|
|
23
|
+
tree = DirectoryTree(
|
|
24
|
+
root_dir=root_dir,
|
|
25
|
+
dir_only=args.dir_only,
|
|
26
|
+
files_only=args.files_only,
|
|
27
|
+
dirs_first=args.dirs_first,
|
|
28
|
+
files_first=args.files_first,
|
|
29
|
+
no_pipes=args.no_pipes,
|
|
30
|
+
ignore=args.ignore,
|
|
31
|
+
use_gitignore=args.gitignore,
|
|
32
|
+
depth_level=args.depth_level,
|
|
33
|
+
output_file=args.output_file,
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
tree.generate()
|
|
37
|
+
|
|
38
|
+
except KeyboardInterrupt:
|
|
39
|
+
print('\nOperation cancelled.', file=sys.stderr)
|
|
40
|
+
sys.exit(130)
|
|
41
|
+
|
|
42
|
+
except Exception as e:
|
|
43
|
+
print(f'Error: {e}', file=sys.stderr)
|
|
44
|
+
sys.exit(1)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
if __name__ == '__main__':
|
|
48
|
+
main()
|
pyletree/cli.py
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
'''This module provides the Pyletree CLI.'''
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
|
|
5
|
+
from . import __version__
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def parse_cmd_line_arguments() -> argparse.Namespace:
|
|
9
|
+
parser = argparse.ArgumentParser(
|
|
10
|
+
prog='pyletree',
|
|
11
|
+
description='Generate a directory tree',
|
|
12
|
+
epilog='Thanks for using Pyletree!',
|
|
13
|
+
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
parser.add_argument(
|
|
17
|
+
'-v',
|
|
18
|
+
'--version',
|
|
19
|
+
action='version',
|
|
20
|
+
version=f'Pyletree v{__version__}',
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
parser.add_argument(
|
|
24
|
+
'root_dir',
|
|
25
|
+
metavar='ROOT_DIR',
|
|
26
|
+
nargs='?',
|
|
27
|
+
default='.',
|
|
28
|
+
help='root directory to generate the tree from',
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
mode = parser.add_mutually_exclusive_group()
|
|
32
|
+
mode.add_argument(
|
|
33
|
+
'-d',
|
|
34
|
+
'--dir-only',
|
|
35
|
+
action='store_true',
|
|
36
|
+
help='show directories only',
|
|
37
|
+
)
|
|
38
|
+
mode.add_argument(
|
|
39
|
+
'-f',
|
|
40
|
+
'--files-only',
|
|
41
|
+
action='store_true',
|
|
42
|
+
help='show files only',
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
ordering = parser.add_mutually_exclusive_group()
|
|
46
|
+
ordering.add_argument(
|
|
47
|
+
'-df',
|
|
48
|
+
'--dirs-first',
|
|
49
|
+
action='store_true',
|
|
50
|
+
help='list directories before files',
|
|
51
|
+
)
|
|
52
|
+
ordering.add_argument(
|
|
53
|
+
'-ff',
|
|
54
|
+
'--files-first',
|
|
55
|
+
action='store_true',
|
|
56
|
+
help='list files before directories',
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
parser.add_argument(
|
|
60
|
+
'-n',
|
|
61
|
+
'--no-pipes',
|
|
62
|
+
action='store_true',
|
|
63
|
+
help='remove vertical pipes between branches',
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
parser.add_argument(
|
|
67
|
+
'-i',
|
|
68
|
+
'--ignore',
|
|
69
|
+
metavar='PATTERN',
|
|
70
|
+
nargs='*',
|
|
71
|
+
default=None,
|
|
72
|
+
help='ignore files or directories (e.g. *.py __pycache__)',
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
parser.add_argument(
|
|
76
|
+
'-gi',
|
|
77
|
+
'--gitignore',
|
|
78
|
+
action='store_true',
|
|
79
|
+
help='respect .gitignore rules',
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
parser.add_argument(
|
|
83
|
+
'-dl',
|
|
84
|
+
'--depth-level',
|
|
85
|
+
metavar='N',
|
|
86
|
+
type=int,
|
|
87
|
+
help='limit tree depth (>= 0)',
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
parser.add_argument(
|
|
91
|
+
'-o',
|
|
92
|
+
'--output-file',
|
|
93
|
+
metavar='FILE',
|
|
94
|
+
help='write output to file (markdown format)',
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
args = parser.parse_args()
|
|
98
|
+
|
|
99
|
+
# validações
|
|
100
|
+
if (args.dir_only or args.files_only) and (
|
|
101
|
+
args.dirs_first or args.files_first
|
|
102
|
+
):
|
|
103
|
+
parser.error('ordering options cannot be used with --dir-only or --files-only')
|
|
104
|
+
|
|
105
|
+
if args.depth_level is not None and args.depth_level < 0:
|
|
106
|
+
parser.error('--depth-level must be >= 0')
|
|
107
|
+
|
|
108
|
+
return args
|
pyletree/pyletree.py
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
'''This module provides Pyletree main module.'''
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import pathlib
|
|
6
|
+
import sys
|
|
7
|
+
from collections import deque
|
|
8
|
+
from fnmatch import fnmatch
|
|
9
|
+
from typing import Deque, List, Optional, Set
|
|
10
|
+
|
|
11
|
+
PIPE = '│'
|
|
12
|
+
ELBOW = '└──'
|
|
13
|
+
TEE = '├──'
|
|
14
|
+
PIPE_PREFIX = '│ '
|
|
15
|
+
SPACE_PREFIX = ' '
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class DirectoryTree:
|
|
19
|
+
def __init__(
|
|
20
|
+
self,
|
|
21
|
+
root_dir: pathlib.Path,
|
|
22
|
+
*,
|
|
23
|
+
dir_only: bool = False,
|
|
24
|
+
files_only: bool = False,
|
|
25
|
+
dirs_first: bool = False,
|
|
26
|
+
files_first: bool = False,
|
|
27
|
+
no_pipes: bool = False,
|
|
28
|
+
ignore: Optional[List[str]] = None,
|
|
29
|
+
use_gitignore: bool = False,
|
|
30
|
+
depth_level: Optional[int] = None,
|
|
31
|
+
output_file: Optional[str] = None,
|
|
32
|
+
) -> None:
|
|
33
|
+
self._output_file = output_file
|
|
34
|
+
self._generator = _TreeGenerator(
|
|
35
|
+
root_dir=root_dir,
|
|
36
|
+
dir_only=dir_only,
|
|
37
|
+
files_only=files_only,
|
|
38
|
+
dirs_first=dirs_first,
|
|
39
|
+
files_first=files_first,
|
|
40
|
+
no_pipes=no_pipes,
|
|
41
|
+
ignore=ignore,
|
|
42
|
+
use_gitignore=use_gitignore,
|
|
43
|
+
depth_level=depth_level,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
def generate(self) -> None:
|
|
47
|
+
tree = self._generator.build_tree()
|
|
48
|
+
|
|
49
|
+
if self._output_file:
|
|
50
|
+
tree.appendleft('```')
|
|
51
|
+
tree.append('```')
|
|
52
|
+
with open(self._output_file, 'w', encoding='utf-8') as f:
|
|
53
|
+
for line in tree:
|
|
54
|
+
print(line, file=f)
|
|
55
|
+
else:
|
|
56
|
+
for line in tree:
|
|
57
|
+
print(line)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class _TreeGenerator:
|
|
61
|
+
def __init__(
|
|
62
|
+
self,
|
|
63
|
+
*,
|
|
64
|
+
root_dir: pathlib.Path,
|
|
65
|
+
dir_only: bool,
|
|
66
|
+
files_only: bool,
|
|
67
|
+
dirs_first: bool,
|
|
68
|
+
files_first: bool,
|
|
69
|
+
no_pipes: bool,
|
|
70
|
+
ignore: Optional[List[str]],
|
|
71
|
+
use_gitignore: bool,
|
|
72
|
+
depth_level: Optional[int],
|
|
73
|
+
) -> None:
|
|
74
|
+
self._root_dir = root_dir.resolve()
|
|
75
|
+
self._dir_only = dir_only
|
|
76
|
+
self._files_only = files_only
|
|
77
|
+
self._dirs_first = dirs_first
|
|
78
|
+
self._files_first = files_first
|
|
79
|
+
self._no_pipes = no_pipes
|
|
80
|
+
self._ignore: Set[str] = set(ignore or [])
|
|
81
|
+
self._depth_level = depth_level
|
|
82
|
+
self._tree: Deque[str] = deque()
|
|
83
|
+
|
|
84
|
+
self._gitignore = None
|
|
85
|
+
if use_gitignore:
|
|
86
|
+
try:
|
|
87
|
+
import pathspec
|
|
88
|
+
|
|
89
|
+
gitignore = self._root_dir / '.gitignore'
|
|
90
|
+
if gitignore.exists():
|
|
91
|
+
patterns = gitignore.read_text().splitlines()
|
|
92
|
+
self._gitignore = pathspec.PathSpec.from_lines(
|
|
93
|
+
'gitwildmatch', patterns
|
|
94
|
+
)
|
|
95
|
+
except ImportError:
|
|
96
|
+
print('Warning: pathspec not installed', file=sys.stderr)
|
|
97
|
+
|
|
98
|
+
def build_tree(self) -> Deque[str]:
|
|
99
|
+
root_name = self._root_dir.name or str(self._root_dir)
|
|
100
|
+
self._tree.append(f'{root_name}/')
|
|
101
|
+
|
|
102
|
+
if not self._no_pipes:
|
|
103
|
+
entries = self._prepare_entries(self._root_dir)
|
|
104
|
+
if entries:
|
|
105
|
+
self._tree.append(PIPE)
|
|
106
|
+
|
|
107
|
+
self._tree_body(self._root_dir, prefix='', depth=0)
|
|
108
|
+
return self._tree
|
|
109
|
+
|
|
110
|
+
def _tree_body(
|
|
111
|
+
self,
|
|
112
|
+
directory: pathlib.Path,
|
|
113
|
+
prefix: str,
|
|
114
|
+
depth: int,
|
|
115
|
+
) -> None:
|
|
116
|
+
if self._depth_level is not None and depth >= self._depth_level:
|
|
117
|
+
return
|
|
118
|
+
|
|
119
|
+
entries = self._prepare_entries(directory)
|
|
120
|
+
if not entries:
|
|
121
|
+
return
|
|
122
|
+
|
|
123
|
+
last_index = len(entries) - 1
|
|
124
|
+
|
|
125
|
+
for index, entry in enumerate(entries):
|
|
126
|
+
is_last = index == last_index
|
|
127
|
+
connector = ELBOW if is_last else TEE
|
|
128
|
+
|
|
129
|
+
self._tree.append(
|
|
130
|
+
f'{prefix}{connector} {entry.name}{'/' if entry.is_dir() else ''}'
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
if entry.is_dir():
|
|
134
|
+
new_prefix = prefix + (SPACE_PREFIX if is_last else PIPE_PREFIX)
|
|
135
|
+
self._tree_body(entry, new_prefix, depth + 1)
|
|
136
|
+
|
|
137
|
+
if not self._no_pipes and not is_last:
|
|
138
|
+
self._tree.append(prefix + PIPE)
|
|
139
|
+
|
|
140
|
+
def _prepare_entries(self, directory: pathlib.Path) -> List[pathlib.Path]:
|
|
141
|
+
try:
|
|
142
|
+
entries = sorted(directory.iterdir(), key=lambda e: e.name.lower())
|
|
143
|
+
except PermissionError:
|
|
144
|
+
return []
|
|
145
|
+
|
|
146
|
+
entries = [e for e in entries if not self._is_ignored(e)]
|
|
147
|
+
|
|
148
|
+
if self._dir_only:
|
|
149
|
+
return [e for e in entries if e.is_dir()]
|
|
150
|
+
|
|
151
|
+
if self._files_only:
|
|
152
|
+
return [e for e in entries if e.is_file()]
|
|
153
|
+
|
|
154
|
+
if self._dirs_first:
|
|
155
|
+
entries.sort(key=lambda e: (e.is_file(), e.name.lower()))
|
|
156
|
+
elif self._files_first:
|
|
157
|
+
entries.sort(key=lambda e: (e.is_dir(), e.name.lower()))
|
|
158
|
+
|
|
159
|
+
return entries
|
|
160
|
+
|
|
161
|
+
def _is_ignored(self, entry: pathlib.Path) -> bool:
|
|
162
|
+
for pattern in self._ignore:
|
|
163
|
+
if fnmatch(entry.name, pattern):
|
|
164
|
+
return True
|
|
165
|
+
|
|
166
|
+
if self._gitignore:
|
|
167
|
+
try:
|
|
168
|
+
rel = entry.relative_to(self._root_dir)
|
|
169
|
+
rel_str = str(rel)
|
|
170
|
+
|
|
171
|
+
if self._gitignore.match_file(rel_str):
|
|
172
|
+
return True
|
|
173
|
+
|
|
174
|
+
if entry.is_dir() and self._gitignore.match_file(rel_str + '/'):
|
|
175
|
+
return True
|
|
176
|
+
|
|
177
|
+
except ValueError:
|
|
178
|
+
pass
|
|
179
|
+
|
|
180
|
+
return False
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pyletree
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Generate directory tree diagrams from the command line
|
|
5
|
+
Author: Davi Reis Furtado, Leodanis Pozo Ramos
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2021 Real Python
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/davi-furtado/pyletree
|
|
29
|
+
Requires-Python: >=3.8
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
License-File: LICENSE
|
|
32
|
+
Requires-Dist: pathspec
|
|
33
|
+
Dynamic: license-file
|
|
34
|
+
|
|
35
|
+
<div align="center">
|
|
36
|
+
<h1 align="center">Pyletree</h1>
|
|
37
|
+
|
|
38
|
+
<img src="https://img.shields.io/badge/python-3.8%2B-blue">
|
|
39
|
+
<img src="https://img.shields.io/badge/license-MIT-green">
|
|
40
|
+
<img src="https://img.shields.io/badge/version-1.0.0-orange">
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<p align="right"><i>Pyletree is a simple and fast CLI tool to generate directory tree diagrams.</i></p>
|
|
44
|
+
|
|
45
|
+
## Installation
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pip install pyletree
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Usage
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pyletree [ROOT_DIR]
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
If no directory is provided, the current directory is used:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
pyletree
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Show help:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
pyletree -h
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Options
|
|
70
|
+
|
|
71
|
+
### General
|
|
72
|
+
|
|
73
|
+
- `-h`, `--help` Show help message
|
|
74
|
+
- `-v`, `--version` Show version
|
|
75
|
+
|
|
76
|
+
### Modes
|
|
77
|
+
|
|
78
|
+
- `-d`, `--dir-only` Show directories only
|
|
79
|
+
- `-f`, `--files-only` Show files only
|
|
80
|
+
|
|
81
|
+
### Ordering
|
|
82
|
+
|
|
83
|
+
- `-df`, `--dirs-first` List directories before files
|
|
84
|
+
- `-ff`, `--files-first` List files before directories
|
|
85
|
+
|
|
86
|
+
> Alphabetical order is always applied as base sorting.
|
|
87
|
+
|
|
88
|
+
### Display
|
|
89
|
+
|
|
90
|
+
- `-n`, `--no-pipes` Remove vertical pipes between branches
|
|
91
|
+
|
|
92
|
+
### Ignoring
|
|
93
|
+
|
|
94
|
+
- `-i`, `--ignore PATTERN [PATTERN ...]` Ignore files/directories
|
|
95
|
+
- `-gi`, `--gitignore` Respect `.gitignore` rules
|
|
96
|
+
|
|
97
|
+
### Depth
|
|
98
|
+
|
|
99
|
+
- `-dl`, `--depth-level N` Limit depth
|
|
100
|
+
|
|
101
|
+
### Output
|
|
102
|
+
|
|
103
|
+
- `-o`, `--output-file FILE` Save output to file (Markdown format)
|
|
104
|
+
|
|
105
|
+
## Examples
|
|
106
|
+
|
|
107
|
+
Basic:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
pyletree
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Directories first:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
pyletree . -df
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Files only:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
pyletree . -f
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Limit depth:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
pyletree . -dl 2
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Ignore entries:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
pyletree . -i node_modules dist .git
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Use `.gitignore`:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
pyletree . -gi
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
No pipes mode:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
pyletree . -n
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Save to file:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
pyletree . -o tree.md
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Sample Output
|
|
156
|
+
|
|
157
|
+
### Default
|
|
158
|
+
|
|
159
|
+
```text
|
|
160
|
+
project/
|
|
161
|
+
│
|
|
162
|
+
├── src/
|
|
163
|
+
│ ├── main.py
|
|
164
|
+
│ └── utils.py
|
|
165
|
+
│
|
|
166
|
+
├── tests/
|
|
167
|
+
│ └── test_main.py
|
|
168
|
+
│
|
|
169
|
+
└── README.md
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### No pipes (`-n`)
|
|
173
|
+
|
|
174
|
+
```text
|
|
175
|
+
project/
|
|
176
|
+
├── src/
|
|
177
|
+
│ ├── main.py
|
|
178
|
+
│ └── utils.py
|
|
179
|
+
├── tests/
|
|
180
|
+
│ └── test_main.py
|
|
181
|
+
└── README.md
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## Features
|
|
185
|
+
|
|
186
|
+
- Clean and readable tree output
|
|
187
|
+
- `.gitignore` support (it does not ignore either the `.git` directory or the `.gitignore` file; if you want to ignore them, add them to the ignore patterns)
|
|
188
|
+
- Custom ignore patterns
|
|
189
|
+
- Depth limiting
|
|
190
|
+
- Flexible sorting
|
|
191
|
+
- Optional compact mode (`--no-pipes`)
|
|
192
|
+
|
|
193
|
+
## Release History
|
|
194
|
+
|
|
195
|
+
### 1.0.0
|
|
196
|
+
|
|
197
|
+
- Initial release
|
|
198
|
+
|
|
199
|
+
## Authors
|
|
200
|
+
|
|
201
|
+
Davi Reis Furtado
|
|
202
|
+
|
|
203
|
+
**Original RP Tree Author:**
|
|
204
|
+
Leodanis Pozo Ramos
|
|
205
|
+
|
|
206
|
+
## License
|
|
207
|
+
|
|
208
|
+
_Pyletree_ is distributed under the MIT license. See [LICENSE](LICENSE) for more information.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
pyletree/__init__.py,sha256=1sOP-7TZCSgyXVqLJvp3-578zvUPUJoic2ZPha5xmq0,110
|
|
2
|
+
pyletree/__main__.py,sha256=nNrE3-ObCkC51tFL-cxzEK3EtZiO-o4mk_nBsOTn0WY,1257
|
|
3
|
+
pyletree/cli.py,sha256=4_oNljshZlV7RnJXk3RLC8khmrMV2SAGPTDtXBz_yTg,2616
|
|
4
|
+
pyletree/pyletree.py,sha256=veN4JmV1VYgLGiljvZTB2z7I7WUJl7iKvDg5lnYHvoE,5506
|
|
5
|
+
pyletree-1.0.0.dist-info/licenses/LICENSE,sha256=pENUFHvskdPC8qj2Sf-XjwRDgCwz5cD4bg5A-BJr_jw,1089
|
|
6
|
+
pyletree-1.0.0.dist-info/METADATA,sha256=NogojFKkwVU3OpILZa8KMeMxBg03zh5qbc5HVIMqCFk,4383
|
|
7
|
+
pyletree-1.0.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
8
|
+
pyletree-1.0.0.dist-info/entry_points.txt,sha256=5x_IatHdODVLBMn1RluFPCAztyVIgCkMc1MwCtSj0y0,52
|
|
9
|
+
pyletree-1.0.0.dist-info/top_level.txt,sha256=RXW33Hcj8p9OxX53oLBGl8n4no4az0HZSjqTD-uYI7o,9
|
|
10
|
+
pyletree-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Real Python
|
|
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.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pyletree
|