pretty-mod 0.1.2__pp310-pypy310_pp73-musllinux_1_2_armv7l.whl → 0.2.1__pp310-pypy310_pp73-musllinux_1_2_armv7l.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.
- pretty_mod/__main__.py +6 -0
- pretty_mod/_pretty_mod.pyi +7 -2
- pretty_mod/_pretty_mod.pypy310-pp73-arm-linux-gnu.so +0 -0
- pretty_mod/cli.py +21 -2
- {pretty_mod-0.1.2.dist-info → pretty_mod-0.2.1.dist-info}/METADATA +117 -74
- pretty_mod-0.2.1.dist-info/RECORD +13 -0
- pretty_mod-0.1.2.dist-info/RECORD +0 -12
- {pretty_mod-0.1.2.dist-info → pretty_mod-0.2.1.dist-info}/WHEEL +0 -0
- {pretty_mod-0.1.2.dist-info → pretty_mod-0.2.1.dist-info}/entry_points.txt +0 -0
- {pretty_mod-0.1.2.dist-info → pretty_mod-0.2.1.dist-info}/licenses/LICENSE +0 -0
pretty_mod/__main__.py
ADDED
pretty_mod/_pretty_mod.pyi
CHANGED
@@ -14,7 +14,12 @@ class ModuleTreeExplorer:
|
|
14
14
|
def get_tree_string(self) -> str: ...
|
15
15
|
|
16
16
|
def display_tree(
|
17
|
-
root_module_path: str,
|
17
|
+
root_module_path: str,
|
18
|
+
max_depth: int = 2,
|
19
|
+
quiet: bool = False,
|
20
|
+
format: str = "pretty",
|
18
21
|
) -> None: ...
|
19
|
-
def display_signature(
|
22
|
+
def display_signature(
|
23
|
+
import_path: str, quiet: bool = False, format: str = "pretty"
|
24
|
+
) -> str: ...
|
20
25
|
def import_object(import_path: str) -> Any: ...
|
Binary file
|
pretty_mod/cli.py
CHANGED
@@ -26,6 +26,14 @@ def main():
|
|
26
26
|
action="store_true",
|
27
27
|
help="Suppress warnings and informational messages",
|
28
28
|
)
|
29
|
+
tree_parser.add_argument(
|
30
|
+
"-o",
|
31
|
+
"--output",
|
32
|
+
type=str,
|
33
|
+
choices=["pretty", "json"],
|
34
|
+
default="pretty",
|
35
|
+
help="Output format (default: pretty)",
|
36
|
+
)
|
29
37
|
|
30
38
|
sig_parser = subparsers.add_parser("sig", help="Display function signature")
|
31
39
|
sig_parser.add_argument(
|
@@ -36,14 +44,25 @@ def main():
|
|
36
44
|
action="store_true",
|
37
45
|
help="Suppress download messages",
|
38
46
|
)
|
47
|
+
sig_parser.add_argument(
|
48
|
+
"-o",
|
49
|
+
"--output",
|
50
|
+
type=str,
|
51
|
+
choices=["pretty", "json"],
|
52
|
+
default="pretty",
|
53
|
+
help="Output format (default: pretty)",
|
54
|
+
)
|
39
55
|
|
40
56
|
args = parser.parse_args()
|
41
57
|
|
42
58
|
try:
|
43
59
|
if args.command == "tree":
|
44
|
-
display_tree
|
60
|
+
# Call display_tree with format parameter
|
61
|
+
display_tree(args.module, args.depth, args.quiet, args.output)
|
45
62
|
elif args.command == "sig":
|
46
|
-
|
63
|
+
# Call display_signature with format parameter
|
64
|
+
result = display_signature(args.import_path, args.quiet, args.output)
|
65
|
+
print(result)
|
47
66
|
else:
|
48
67
|
parser.print_help()
|
49
68
|
sys.exit(1)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: pretty-mod
|
3
|
-
Version: 0.1
|
3
|
+
Version: 0.2.1
|
4
4
|
License-File: LICENSE
|
5
5
|
Summary: A python module tree explorer for LLMs (and humans)
|
6
6
|
Author-email: zzstoatzz <thrast36@gmail.com>
|
@@ -12,8 +12,9 @@ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
12
12
|
|
13
13
|
a python module tree explorer for LLMs (and humans)
|
14
14
|
|
15
|
-
> [!
|
16
|
-
>
|
15
|
+
> [!NOTE]
|
16
|
+
> - For all versions `>=0.1.0`, wheels for different operating systems are built via `maturin` and published to PyPI. Install `<0.1.0` for a pure Python version.
|
17
|
+
> - Starting from v0.2.0, output includes colors by default. Use `PRETTY_MOD_NO_COLOR=1` to disable.
|
17
18
|
|
18
19
|
```bash
|
19
20
|
# Explore module structure
|
@@ -32,57 +33,89 @@ a python module tree explorer for LLMs (and humans)
|
|
32
33
|
└── 📦 tool
|
33
34
|
└── ⚡ functions: main
|
34
35
|
|
35
|
-
# Inspect function signatures
|
36
|
-
»
|
37
|
-
📎
|
38
|
-
├──
|
39
|
-
├──
|
40
|
-
├──
|
41
|
-
├──
|
42
|
-
├──
|
43
|
-
├──
|
44
|
-
├──
|
45
|
-
├──
|
46
|
-
├──
|
47
|
-
├──
|
48
|
-
├──
|
49
|
-
├──
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
├──
|
56
|
-
├──
|
57
|
-
├──
|
58
|
-
├──
|
59
|
-
├──
|
60
|
-
|
61
|
-
|
62
|
-
├──
|
63
|
-
|
64
|
-
├── 📦 auth
|
65
|
-
│ └── 🔷 classes: AuthBase, HTTPBasicAuth, HTTPDigestAuth, HTTPProxyAuth
|
66
|
-
├── 📦 certs
|
67
|
-
├── 📦 compat
|
68
|
-
├── 📦 cookies
|
69
|
-
├── 📦 exceptions
|
70
|
-
├── 📦 help
|
71
|
-
├── 📦 hooks
|
72
|
-
├── 📦 models
|
73
|
-
├── 📦 sessions
|
74
|
-
├── 📦 status_codes
|
75
|
-
├── 📦 structures
|
76
|
-
└── 📦 utils
|
36
|
+
# Inspect function signatures (even if the package is not installed)
|
37
|
+
» uv run pretty-mod sig fastmcp:FastMCP --quiet
|
38
|
+
📎 FastMCP
|
39
|
+
├── Parameters:
|
40
|
+
├── self
|
41
|
+
├── name: str | None=None
|
42
|
+
├── instructions: str | None=None
|
43
|
+
├── auth: OAuthProvider | None=None
|
44
|
+
├── lifespan: Callable[[FastMCP[LifespanResultT]], AbstractAsyncContextManager[LifespanResultT]] | None=None
|
45
|
+
├── tool_serializer: Callable[[Any], str] | None=None
|
46
|
+
├── cache_expiration_seconds: float | None=None
|
47
|
+
├── on_duplicate_tools: DuplicateBehavior | None=None
|
48
|
+
├── on_duplicate_resources: DuplicateBehavior | None=None
|
49
|
+
├── on_duplicate_prompts: DuplicateBehavior | None=None
|
50
|
+
├── resource_prefix_format: Literal['protocol', 'path'] | None=None
|
51
|
+
├── mask_error_details: bool | None=None
|
52
|
+
├── tools: list[Tool | Callable[..., Any]] | None=None
|
53
|
+
├── dependencies: list[str] | None=None
|
54
|
+
├── include_tags: set[str] | None=None
|
55
|
+
├── exclude_tags: set[str] | None=None
|
56
|
+
├── log_level: str | None=None
|
57
|
+
├── debug: bool | None=None
|
58
|
+
├── host: str | None=None
|
59
|
+
├── port: int | None=None
|
60
|
+
├── sse_path: str | None=None
|
61
|
+
├── message_path: str | None=None
|
62
|
+
├── streamable_http_path: str | None=None
|
63
|
+
├── json_response: bool | None=None
|
64
|
+
└── stateless_http: bool | None=None
|
77
65
|
```
|
78
66
|
|
79
|
-
##
|
67
|
+
## installation
|
80
68
|
|
81
69
|
```bash
|
82
70
|
uv add pretty-mod
|
83
71
|
```
|
84
72
|
|
85
|
-
|
73
|
+
|
74
|
+
## cli
|
75
|
+
|
76
|
+
`pretty-mod` includes a command-line interface for shell-based exploration:
|
77
|
+
|
78
|
+
> [!IMPORTANT]
|
79
|
+
> all commands below can be run ephemerally with `uvx`, e.g. `uvx pretty-mod tree json`
|
80
|
+
|
81
|
+
```bash
|
82
|
+
# Explore module structure
|
83
|
+
pretty-mod tree json
|
84
|
+
|
85
|
+
# Go deeper into the tree with --depth
|
86
|
+
pretty-mod tree requests --depth 3
|
87
|
+
|
88
|
+
# Display function signatures
|
89
|
+
pretty-mod sig json:loads
|
90
|
+
|
91
|
+
# Get JSON output for programmatic use
|
92
|
+
pretty-mod tree json -o json | jq '.tree.submodules | keys'
|
93
|
+
pretty-mod sig json:dumps -o json | jq '.parameters'
|
94
|
+
pretty-mod sig os.path:join
|
95
|
+
|
96
|
+
# Explore packages even without having them installed
|
97
|
+
pretty-mod tree django
|
98
|
+
pretty-mod tree flask --depth 1
|
99
|
+
|
100
|
+
# Use --quiet to suppress download messages
|
101
|
+
pretty-mod tree requests --quiet
|
102
|
+
|
103
|
+
# Version specifiers - explore specific versions
|
104
|
+
pretty-mod tree toml@0.10.2
|
105
|
+
pretty-mod sig toml@0.10.2:loads
|
106
|
+
|
107
|
+
# Submodules with version specifiers (correct syntax)
|
108
|
+
pretty-mod tree prefect.server@2.10.0 # ✅ Works
|
109
|
+
pretty-mod tree prefect@2.10.0.server # ❌ Invalid - version must come last
|
110
|
+
|
111
|
+
# Package name differs from module name
|
112
|
+
pretty-mod tree pydocket::docket # PyPI package 'pydocket' contains module 'docket'
|
113
|
+
pretty-mod tree pillow::PIL # PyPI package 'pillow' contains module 'PIL'
|
114
|
+
pretty-mod tree pillow::PIL@10.0.0 # Specific version of pillow
|
115
|
+
pretty-mod sig pillow::PIL.Image:open # Works with signatures too
|
116
|
+
```
|
117
|
+
|
118
|
+
## python sdk
|
86
119
|
|
87
120
|
```python
|
88
121
|
from pretty_mod import display_tree
|
@@ -134,45 +167,55 @@ print(display_signature("json:loads"))
|
|
134
167
|
```
|
135
168
|
</details>
|
136
169
|
|
137
|
-
##
|
170
|
+
## customization
|
138
171
|
|
139
|
-
|
172
|
+
pretty-mod supports extensive customization through environment variables:
|
140
173
|
|
141
|
-
|
142
|
-
> all commands below can be run ephemerally with `uvx`, e.g. `uvx pretty-mod tree json`
|
174
|
+
### display characters
|
143
175
|
|
144
176
|
```bash
|
145
|
-
#
|
146
|
-
pretty-mod tree json
|
147
|
-
|
148
|
-
# Go deeper into the tree with --depth
|
149
|
-
pretty-mod tree requests --depth 3
|
177
|
+
# Use ASCII-only mode for terminals without Unicode support
|
178
|
+
PRETTY_MOD_ASCII=1 pretty-mod tree json
|
150
179
|
|
151
|
-
#
|
152
|
-
pretty-mod
|
153
|
-
pretty-mod
|
154
|
-
|
155
|
-
|
156
|
-
pretty-mod tree django
|
157
|
-
pretty-mod tree flask --depth 1
|
180
|
+
# Customize individual icons
|
181
|
+
PRETTY_MOD_MODULE_ICON="[M]" pretty-mod tree json
|
182
|
+
PRETTY_MOD_FUNCTION_ICON="fn" pretty-mod tree json
|
183
|
+
PRETTY_MOD_CLASS_ICON="cls" pretty-mod tree json
|
184
|
+
```
|
158
185
|
|
159
|
-
|
160
|
-
pretty-mod tree requests --quiet
|
186
|
+
### colors
|
161
187
|
|
162
|
-
|
163
|
-
pretty-mod tree toml@0.10.2
|
164
|
-
pretty-mod sig toml@0.10.2:loads
|
188
|
+
pretty-mod uses an earth-tone color scheme by default:
|
165
189
|
|
166
|
-
|
167
|
-
|
168
|
-
pretty-mod tree
|
190
|
+
```bash
|
191
|
+
# Disable colors entirely
|
192
|
+
PRETTY_MOD_NO_COLOR=1 pretty-mod tree json
|
193
|
+
# or use the standard NO_COLOR environment variable
|
194
|
+
NO_COLOR=1 pretty-mod tree json
|
195
|
+
|
196
|
+
# Override specific colors with hex values
|
197
|
+
PRETTY_MOD_MODULE_COLOR="#FF6B6B" pretty-mod tree json
|
198
|
+
PRETTY_MOD_FUNCTION_COLOR="#4ECDC4" pretty-mod tree json
|
169
199
|
```
|
170
200
|
|
171
|
-
|
201
|
+
available color environment variables:
|
202
|
+
- `PRETTY_MOD_MODULE_COLOR` - Modules/packages (default: #8B7355)
|
203
|
+
- `PRETTY_MOD_FUNCTION_COLOR` - Functions (default: #6B8E23)
|
204
|
+
- `PRETTY_MOD_CLASS_COLOR` - Classes (default: #4682B4)
|
205
|
+
- `PRETTY_MOD_CONSTANT_COLOR` - Constants (default: #BC8F8F)
|
206
|
+
- `PRETTY_MOD_EXPORTS_COLOR` - __all__ exports (default: #9370DB)
|
207
|
+
- `PRETTY_MOD_SIGNATURE_COLOR` - Signatures (default: #5F9EA0)
|
208
|
+
- `PRETTY_MOD_TREE_COLOR` - Tree structure lines (default: #696969)
|
209
|
+
- `PRETTY_MOD_PARAM_COLOR` - Parameter names (default: #708090)
|
210
|
+
- `PRETTY_MOD_TYPE_COLOR` - Type annotations (default: #778899)
|
211
|
+
- `PRETTY_MOD_DEFAULT_COLOR` - Default values (default: #8FBC8F)
|
212
|
+
- `PRETTY_MOD_WARNING_COLOR` - Warning messages (default: #DAA520)
|
213
|
+
|
214
|
+
## examples
|
172
215
|
|
173
|
-
|
216
|
+
see the [`examples/`](examples/) directory for more detailed usage patterns and advanced features.
|
174
217
|
|
175
|
-
##
|
218
|
+
## development
|
176
219
|
|
177
220
|
```bash
|
178
221
|
gh repo clone zzstoatzz/pretty-mod && cd pretty-mod
|
@@ -0,0 +1,13 @@
|
|
1
|
+
pretty_mod-0.2.1.dist-info/METADATA,sha256=V0bvo8o_wUlCzzBYn_FUPyyY2NboTV-FeFbYOmiDloQ,8419
|
2
|
+
pretty_mod-0.2.1.dist-info/WHEEL,sha256=zOnM_2iPV8A5xUfz2tM48ge0BMblPtv6mKgeZWqiTo0,114
|
3
|
+
pretty_mod-0.2.1.dist-info/entry_points.txt,sha256=aNlomjGTypAOUeZiSZ4OYFY-QVq2KmDXkO9QFS45uW4,49
|
4
|
+
pretty_mod-0.2.1.dist-info/licenses/LICENSE,sha256=t4-aJACJSRrl4B6UnAoE9JRQY_uacSfllsrgf0ezefo,1067
|
5
|
+
pretty_mod.libs/libgcc_s-5b5488a6.so.1,sha256=HGKUsVmTeNAxEdSy7Ua5Vh_I9FN3RCbPWzvZ7H_TrwE,2749061
|
6
|
+
pretty_mod/__init__.py,sha256=jVcaTvbU6PZ2b_el4hnF_mmc-thfDOpTvePOS3n4D9c,103
|
7
|
+
pretty_mod/__main__.py,sha256=OghZAl1T0TsQn8ojWXU0jBwL5i-FScwNO3OJBfKsLGw,128
|
8
|
+
pretty_mod/_pretty_mod.pyi,sha256=vZfhGTbrZkjzwMcoBGfOxUeT7KLan_EtkQ4qZAdJnB8,729
|
9
|
+
pretty_mod/_pretty_mod.pypy310-pp73-arm-linux-gnu.so,sha256=r7gnyarcZY2RzSbDWYYHi_VEa8MH0nt129OxZJmp0nY,6737289
|
10
|
+
pretty_mod/cli.py,sha256=o58-OXAZghBVUpruJpufx6hczToPr-7SXhVxJzleHa4,2172
|
11
|
+
pretty_mod/explorer.py,sha256=dWSZi4QH-JvhF8AlKcfpDOrx3-ijsHhhn8tcEsRPYH8,258
|
12
|
+
pretty_mod/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
|
+
pretty_mod-0.2.1.dist-info/RECORD,,
|
@@ -1,12 +0,0 @@
|
|
1
|
-
pretty_mod-0.1.2.dist-info/METADATA,sha256=qMNGAxnmLoRU8k8hbfaCP-pkJxcmXphn6EyqM2lfJnY,6599
|
2
|
-
pretty_mod-0.1.2.dist-info/WHEEL,sha256=zOnM_2iPV8A5xUfz2tM48ge0BMblPtv6mKgeZWqiTo0,114
|
3
|
-
pretty_mod-0.1.2.dist-info/entry_points.txt,sha256=aNlomjGTypAOUeZiSZ4OYFY-QVq2KmDXkO9QFS45uW4,49
|
4
|
-
pretty_mod-0.1.2.dist-info/licenses/LICENSE,sha256=t4-aJACJSRrl4B6UnAoE9JRQY_uacSfllsrgf0ezefo,1067
|
5
|
-
pretty_mod.libs/libgcc_s-5b5488a6.so.1,sha256=HGKUsVmTeNAxEdSy7Ua5Vh_I9FN3RCbPWzvZ7H_TrwE,2749061
|
6
|
-
pretty_mod/__init__.py,sha256=jVcaTvbU6PZ2b_el4hnF_mmc-thfDOpTvePOS3n4D9c,103
|
7
|
-
pretty_mod/_pretty_mod.pyi,sha256=OQs08-sWtiBpXJJvmkue80v5x3rYIsGocQKx6osMRZw,662
|
8
|
-
pretty_mod/_pretty_mod.pypy310-pp73-arm-linux-gnu.so,sha256=OyYPzyPpLiVdxyKa0xStfEIyJ4atBDL1WpVfC3wZh4A,6626641
|
9
|
-
pretty_mod/cli.py,sha256=pehQfJ3KKrv0KRaU9JtTtl3x84wRDCyU-5mEPjVKbcA,1610
|
10
|
-
pretty_mod/explorer.py,sha256=dWSZi4QH-JvhF8AlKcfpDOrx3-ijsHhhn8tcEsRPYH8,258
|
11
|
-
pretty_mod/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
12
|
-
pretty_mod-0.1.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|