pretty-mod 0.1.1__cp310-cp310-win32.whl → 0.2.0__cp310-cp310-win32.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.
Binary file
@@ -16,5 +16,5 @@ class ModuleTreeExplorer:
16
16
  def display_tree(
17
17
  root_module_path: str, max_depth: int = 2, quiet: bool = False
18
18
  ) -> None: ...
19
- def display_signature(import_path: str) -> str: ...
19
+ def display_signature(import_path: str, quiet: bool = False) -> str: ...
20
20
  def import_object(import_path: str) -> Any: ...
pretty_mod/cli.py CHANGED
@@ -31,6 +31,11 @@ def main():
31
31
  sig_parser.add_argument(
32
32
  "import_path", help="Import path to the function (e.g., 'json:loads')"
33
33
  )
34
+ sig_parser.add_argument(
35
+ "--quiet",
36
+ action="store_true",
37
+ help="Suppress download messages",
38
+ )
34
39
 
35
40
  args = parser.parse_args()
36
41
 
@@ -38,7 +43,7 @@ def main():
38
43
  if args.command == "tree":
39
44
  display_tree(args.module, args.depth, args.quiet)
40
45
  elif args.command == "sig":
41
- print(display_signature(args.import_path))
46
+ print(display_signature(args.import_path, args.quiet))
42
47
  else:
43
48
  parser.print_help()
44
49
  sys.exit(1)
@@ -0,0 +1,250 @@
1
+ Metadata-Version: 2.4
2
+ Name: pretty-mod
3
+ Version: 0.2.0
4
+ License-File: LICENSE
5
+ Summary: A python module tree explorer for LLMs (and humans)
6
+ Author-email: zzstoatzz <thrast36@gmail.com>
7
+ License: MIT
8
+ Requires-Python: >=3.9
9
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
10
+
11
+ # pretty-mod
12
+
13
+ a python module tree explorer for LLMs (and humans)
14
+
15
+ > [!IMPORTANT]
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
+
18
+ > [!NOTE]
19
+ > Starting from v0.2.0, output includes colors by default. Use `PRETTY_MOD_NO_COLOR=1` to disable.
20
+
21
+ ```bash
22
+ # Explore module structure
23
+ » uvx pretty-mod tree json
24
+ 📦 json
25
+ ├── 📜 __all__: dump, dumps, load, loads, JSONDecoder, JSONDecodeError, JSONEncoder
26
+ ├── ⚡ functions: dump, dumps, load, loads
27
+ ├── 📦 decoder
28
+ │ ├── 📜 __all__: JSONDecoder, JSONDecodeError
29
+ │ └── 🔷 classes: JSONDecodeError, JSONDecoder
30
+ ├── 📦 encoder
31
+ │ ├── 🔷 classes: JSONEncoder
32
+ │ └── ⚡ functions: py_encode_basestring, py_encode_basestring_ascii
33
+ ├── 📦 scanner
34
+ │ └── 📜 __all__: make_scanner
35
+ └── 📦 tool
36
+ └── ⚡ functions: main
37
+
38
+ # Inspect function signatures (even if the package is not installed)
39
+ » uv run pretty-mod sig fastmcp:FastMCP --quiet
40
+ 📎 FastMCP
41
+ ├── Parameters:
42
+ ├── self
43
+ ├── name: str | None=None
44
+ ├── instructions: str | None=None
45
+ ├── auth: OAuthProvider | None=None
46
+ ├── lifespan: Callable[[FastMCP[LifespanResultT]], AbstractAsyncContextManager[LifespanResultT]] | None=None
47
+ ├── tool_serializer: Callable[[Any], str] | None=None
48
+ ├── cache_expiration_seconds: float | None=None
49
+ ├── on_duplicate_tools: DuplicateBehavior | None=None
50
+ ├── on_duplicate_resources: DuplicateBehavior | None=None
51
+ ├── on_duplicate_prompts: DuplicateBehavior | None=None
52
+ ├── resource_prefix_format: Literal['protocol', 'path'] | None=None
53
+ ├── mask_error_details: bool | None=None
54
+ ├── tools: list[Tool | Callable[..., Any]] | None=None
55
+ ├── dependencies: list[str] | None=None
56
+ ├── include_tags: set[str] | None=None
57
+ ├── exclude_tags: set[str] | None=None
58
+ ├── log_level: str | None=None
59
+ ├── debug: bool | None=None
60
+ ├── host: str | None=None
61
+ ├── port: int | None=None
62
+ ├── sse_path: str | None=None
63
+ ├── message_path: str | None=None
64
+ ├── streamable_http_path: str | None=None
65
+ ├── json_response: bool | None=None
66
+ └── stateless_http: bool | None=None
67
+ ```
68
+
69
+ ## installation
70
+
71
+ ```bash
72
+ uv add pretty-mod
73
+ ```
74
+
75
+
76
+ ## cli
77
+
78
+ `pretty-mod` includes a command-line interface for shell-based exploration:
79
+
80
+ > [!IMPORTANT]
81
+ > all commands below can be run ephemerally with `uvx`, e.g. `uvx pretty-mod tree json`
82
+
83
+ ```bash
84
+ # Explore module structure
85
+ pretty-mod tree json
86
+
87
+ # Go deeper into the tree with --depth
88
+ pretty-mod tree requests --depth 3
89
+
90
+ # Display function signatures
91
+ pretty-mod sig json:loads
92
+ pretty-mod sig os.path:join
93
+
94
+ # Explore packages even without having them installed
95
+ pretty-mod tree django
96
+ pretty-mod tree flask --depth 1
97
+
98
+ # Use --quiet to suppress download messages
99
+ pretty-mod tree requests --quiet
100
+
101
+ # Version specifiers - explore specific versions
102
+ pretty-mod tree toml@0.10.2
103
+ pretty-mod sig toml@0.10.2:loads
104
+
105
+ # Submodules with version specifiers (correct syntax)
106
+ pretty-mod tree prefect.server@2.10.0 # ✅ Works
107
+ pretty-mod tree prefect@2.10.0.server # ❌ Invalid - version must come last
108
+
109
+ # Package name differs from module name
110
+ pretty-mod tree pydocket::docket # PyPI package 'pydocket' contains module 'docket'
111
+ pretty-mod tree pillow::PIL # PyPI package 'pillow' contains module 'PIL'
112
+ pretty-mod tree pillow::PIL@10.0.0 # Specific version of pillow
113
+ pretty-mod sig pillow::PIL.Image:open # Works with signatures too
114
+ ```
115
+
116
+ ## python sdk
117
+
118
+ ```python
119
+ from pretty_mod import display_tree
120
+
121
+ # Explore a module structure
122
+ display_tree("collections", max_depth=2)
123
+ ```
124
+
125
+ <details>
126
+ <summary>Example output</summary>
127
+
128
+ ```text
129
+ display_tree("collections", max_depth=2)
130
+
131
+ 📦 collections
132
+ ├── 📜 __all__: ChainMap, Counter, OrderedDict, UserDict, UserList, UserString, defaultdict, deque, namedtuple
133
+ ├── 🔷 classes: ChainMap, Counter, OrderedDict, UserDict, UserList, UserString, defaultdict, deque
134
+ ├── ⚡ functions: namedtuple
135
+ └── 📦 abc
136
+ ├── 📜 __all__: Awaitable, Coroutine, AsyncIterable, AsyncIterator, AsyncGenerator, Hashable, Iterable, Iterator, Generator, Reversible, Sized, Container, Callable, Collection, Set, MutableSet, Mapping, MutableMapping, MappingView, KeysView, ItemsView, ValuesView, Sequence, MutableSequence, ByteString, Buffer
137
+ └── 🔷 classes: AsyncGenerator, AsyncIterable, AsyncIterator, Awaitable, Buffer, ByteString, Callable, Collection, Container, Coroutine, Generator, Hashable, ItemsView, Iterable, Iterator, KeysView, Mapping, MappingView, MutableMapping, MutableSequence, MutableSet, Reversible, Sequence, Set, Sized, ValuesView
138
+ ```
139
+ </details>
140
+
141
+
142
+
143
+ ```python
144
+ from pretty_mod import display_signature
145
+
146
+ # Display the signature of a callable (function, class constructor, etc.)
147
+ print(display_signature("json:loads"))
148
+ ```
149
+
150
+ <details>
151
+ <summary>Example output</summary>
152
+
153
+ ```text
154
+ 📎 loads
155
+ ├── Parameters:
156
+ ├── s
157
+ ├── *
158
+ ├── cls=None
159
+ ├── object_hook=None
160
+ ├── parse_float=None
161
+ ├── parse_int=None
162
+ ├── parse_constant=None
163
+ ├── object_pairs_hook=None
164
+ └── **kw
165
+ ```
166
+ </details>
167
+
168
+ ## customization
169
+
170
+ pretty-mod supports extensive customization through environment variables:
171
+
172
+ ### display characters
173
+
174
+ ```bash
175
+ # Use ASCII-only mode for terminals without Unicode support
176
+ PRETTY_MOD_ASCII=1 pretty-mod tree json
177
+
178
+ # Customize individual icons
179
+ PRETTY_MOD_MODULE_ICON="[M]" pretty-mod tree json
180
+ PRETTY_MOD_FUNCTION_ICON="fn" pretty-mod tree json
181
+ PRETTY_MOD_CLASS_ICON="cls" pretty-mod tree json
182
+ ```
183
+
184
+ ### colors
185
+
186
+ pretty-mod uses an earth-tone color scheme by default:
187
+
188
+ ```bash
189
+ # Disable colors entirely
190
+ PRETTY_MOD_NO_COLOR=1 pretty-mod tree json
191
+ # or use the standard NO_COLOR environment variable
192
+ NO_COLOR=1 pretty-mod tree json
193
+
194
+ # Override specific colors with hex values
195
+ PRETTY_MOD_MODULE_COLOR="#FF6B6B" pretty-mod tree json
196
+ PRETTY_MOD_FUNCTION_COLOR="#4ECDC4" pretty-mod tree json
197
+ ```
198
+
199
+ available color environment variables:
200
+ - `PRETTY_MOD_MODULE_COLOR` - Modules/packages (default: #8B7355)
201
+ - `PRETTY_MOD_FUNCTION_COLOR` - Functions (default: #6B8E23)
202
+ - `PRETTY_MOD_CLASS_COLOR` - Classes (default: #4682B4)
203
+ - `PRETTY_MOD_CONSTANT_COLOR` - Constants (default: #BC8F8F)
204
+ - `PRETTY_MOD_EXPORTS_COLOR` - __all__ exports (default: #9370DB)
205
+ - `PRETTY_MOD_SIGNATURE_COLOR` - Signatures (default: #5F9EA0)
206
+ - `PRETTY_MOD_TREE_COLOR` - Tree structure lines (default: #696969)
207
+ - `PRETTY_MOD_PARAM_COLOR` - Parameter names (default: #708090)
208
+ - `PRETTY_MOD_TYPE_COLOR` - Type annotations (default: #778899)
209
+ - `PRETTY_MOD_DEFAULT_COLOR` - Default values (default: #8FBC8F)
210
+ - `PRETTY_MOD_WARNING_COLOR` - Warning messages (default: #DAA520)
211
+
212
+ ## examples
213
+
214
+ see the [`examples/`](examples/) directory for more detailed usage patterns and advanced features.
215
+
216
+ ## development
217
+
218
+ ```bash
219
+ gh repo clone zzstoatzz/pretty-mod && cd pretty-mod
220
+ just --list # see https://github.com/casey/just
221
+ ```
222
+
223
+ <details>
224
+ <summary>Performance Testing</summary>
225
+
226
+ The performance test script (`scripts/perf_test.py`) supports both single-run exploration and proper benchmarking with multiple iterations:
227
+
228
+ ```bash
229
+ # Run a proper benchmark with multiple iterations
230
+ ./scripts/perf_test.py json --benchmark
231
+ ./scripts/perf_test.py urllib --benchmark --runs 100 --warmup 10
232
+
233
+ # Compare performance between local and published versions
234
+ just compare-perf prefect 2
235
+
236
+ # Benchmark multiple modules
237
+ just benchmark-modules
238
+
239
+ # Or use shell timing for quick single-run comparisons
240
+ time ./scripts/perf_test.py numpy --depth 3
241
+ time uvx pretty-mod tree numpy --depth 3
242
+ ```
243
+
244
+ Benchmark mode provides:
245
+ - Warmup runs to account for cold starts
246
+ - Multiple iterations for statistical significance
247
+ - Mean, standard deviation, min/max timing statistics
248
+ - Silent operation (no tree output) for accurate timing
249
+
250
+ </details>
@@ -0,0 +1,11 @@
1
+ pretty_mod-0.2.0.dist-info/METADATA,sha256=3XGAL8KBJCHgmfBpLqfmWJplk_f6dS_0DFqRCbh3_4o,8516
2
+ pretty_mod-0.2.0.dist-info/WHEEL,sha256=aBacha0FcFMzjQuVTMCEUEJSXL9SWMbeMaJPxWjGHqE,92
3
+ pretty_mod-0.2.0.dist-info/entry_points.txt,sha256=aNlomjGTypAOUeZiSZ4OYFY-QVq2KmDXkO9QFS45uW4,49
4
+ pretty_mod-0.2.0.dist-info/licenses/LICENSE,sha256=J2cPHis9ZpzSonH9dVASFNtKrAdQmI-6qYBlivuubwA,1087
5
+ pretty_mod/__init__.py,sha256=FWM2poN7eHWyVNly7AqU0RJlDHCrxhnk_k6LPFgyXcc,106
6
+ pretty_mod/_pretty_mod.cp310-win32.pyd,sha256=7kazXVtaM5IL-rZkO7brRKm9fNELrrcJ06PL4XEARik,5281280
7
+ pretty_mod/_pretty_mod.pyi,sha256=NXm_WH1UwB6qLrB6e-U21u0UwKL2w3dQWIiF-TNBxvU,682
8
+ pretty_mod/cli.py,sha256=xxYpUM-vCQ2XF5X0_z1cRyjWvnX8jDbVQuaZ0N23QAQ,1668
9
+ pretty_mod/explorer.py,sha256=3w-oY7edQzQMlAOVUSBqPJ94tiuJZXc45yD9bDHFsTs,268
10
+ pretty_mod/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
+ pretty_mod-0.2.0.dist-info/RECORD,,
@@ -1,173 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: pretty-mod
3
- Version: 0.1.1
4
- License-File: LICENSE
5
- Summary: A module tree explorer for LLMs (and humans)
6
- Author-email: zzstoatzz <thrast36@gmail.com>
7
- License: MIT
8
- Requires-Python: >=3.9
9
- Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
10
-
11
- # pretty-mod
12
-
13
- a module tree explorer for LLMs (and humans)
14
-
15
- > [!IMPORTANT]
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
-
18
- ```bash
19
- » uvx pretty-mod tree json
20
- 📦 json
21
- ├── 📜 __all__: dump, dumps, load, loads, JSONDecoder, JSONDecodeError, JSONEncoder
22
- ├── ⚡ functions: dump, dumps, load, loads
23
- ├── 📦 decoder
24
- │ ├── 📜 __all__: JSONDecoder, JSONDecodeError
25
- │ └── 🔷 classes: JSONDecodeError, JSONDecoder
26
- ├── 📦 encoder
27
- │ ├── 🔷 classes: JSONEncoder
28
- │ └── ⚡ functions: py_encode_basestring, py_encode_basestring_ascii
29
- ├── 📦 scanner
30
- │ └── 📜 __all__: make_scanner
31
- └── 📦 tool
32
- └── ⚡ functions: main
33
-
34
- » uvx pretty-mod sig fastmcp:FastMCP
35
- 📎 FastMCP
36
- ├── Parameters:
37
- ├── name: str | None=None
38
- ├── instructions: str | None=None
39
- ├── auth: OAuthProvider | None=None
40
- ├── lifespan: Callable[[FastMCP[LifespanResultT]], AbstractAsyncContextManager[LifespanResultT]] | None=None
41
- ├── tags: set[str] | None=None
42
- ├── dependencies: list[str] | None=None
43
- ├── tool_serializer: Callable[[Any], str] | None=None
44
- ├── cache_expiration_seconds: float | None=None
45
- ├── on_duplicate_tools: DuplicateBehavior | None=None
46
- ├── on_duplicate_resources: DuplicateBehavior | None=None
47
- ├── on_duplicate_prompts: DuplicateBehavior | None=None
48
- ├── resource_prefix_format: Literal['protocol', 'path'] | None=None
49
- ├── mask_error_details: bool | None=None
50
- ├── tools: list[Tool | Callable[..., Any]] | None=None
51
- └── **settings: Any
52
- ```
53
-
54
- ## Installation
55
-
56
- ```bash
57
- uv add pretty-mod
58
- ```
59
-
60
- ## Usage
61
-
62
- ```python
63
- from pretty_mod import display_tree
64
-
65
- # Explore a module structure
66
- display_tree("collections", max_depth=2)
67
- ```
68
-
69
- <details>
70
- <summary>Example output</summary>
71
-
72
- ```text
73
- display_tree("collections", max_depth=2)
74
-
75
- 📦 collections
76
- ├── 📜 __all__: ChainMap, Counter, OrderedDict, UserDict, UserList, UserString, defaultdict, deque, namedtuple
77
- ├── 🔷 classes: ChainMap, Counter, OrderedDict, UserDict, UserList, UserString, defaultdict, deque
78
- ├── ⚡ functions: namedtuple
79
- └── 📦 abc
80
- ├── 📜 __all__: Awaitable, Coroutine, AsyncIterable, AsyncIterator, AsyncGenerator, Hashable, Iterable, Iterator, Generator, Reversible, Sized, Container, Callable, Collection, Set, MutableSet, Mapping, MutableMapping, MappingView, KeysView, ItemsView, ValuesView, Sequence, MutableSequence, ByteString, Buffer
81
- └── 🔷 classes: AsyncGenerator, AsyncIterable, AsyncIterator, Awaitable, Buffer, ByteString, Callable, Collection, Container, Coroutine, Generator, Hashable, ItemsView, Iterable, Iterator, KeysView, Mapping, MappingView, MutableMapping, MutableSequence, MutableSet, Reversible, Sequence, Set, Sized, ValuesView
82
- ```
83
- </details>
84
-
85
-
86
-
87
- ```python
88
- from pretty_mod import display_signature
89
-
90
- # Display the signature of a callable (function, class constructor, etc.)
91
- print(display_signature("json:loads"))
92
- ```
93
-
94
- <details>
95
- <summary>Example output</summary>
96
-
97
- ```text
98
- 📎 loads
99
- ├── Parameters:
100
- ├── s
101
- ├── *
102
- ├── cls=None
103
- ├── object_hook=None
104
- ├── parse_float=None
105
- ├── parse_int=None
106
- ├── parse_constant=None
107
- ├── object_pairs_hook=None
108
- └── **kw
109
- ```
110
- </details>
111
-
112
- ## CLI
113
-
114
- Pretty-mod includes a command-line interface for quick exploration:
115
-
116
- ```bash
117
- # Explore module structure
118
- pretty-mod tree json
119
-
120
- # Go deeper into the tree with --depth
121
- pretty-mod tree requests --depth 3
122
-
123
- # Display function signatures
124
- pretty-mod sig json:loads
125
- pretty-mod sig os.path:join
126
-
127
- # Explore packages even without having them installed
128
- pretty-mod tree django
129
- pretty-mod tree flask --depth 1
130
-
131
- # Use --quiet to suppress download messages when you don't have the package installed
132
- pretty-mod tree requests --quiet
133
- ```
134
-
135
- ## Examples
136
-
137
- See the [`examples/`](examples/) directory for more detailed usage patterns and advanced features.
138
-
139
- ## Development
140
-
141
- ```bash
142
- gh repo clone zzstoatzz/pretty-mod && cd pretty-mod
143
- just --list # see https://github.com/casey/just
144
- ```
145
-
146
- <details>
147
- <summary>Performance Testing</summary>
148
-
149
- The performance test script (`scripts/perf_test.py`) supports both single-run exploration and proper benchmarking with multiple iterations:
150
-
151
- ```bash
152
- # Run a proper benchmark with multiple iterations
153
- ./scripts/perf_test.py json --benchmark
154
- ./scripts/perf_test.py urllib --benchmark --runs 100 --warmup 10
155
-
156
- # Compare performance between local and published versions
157
- just compare-perf prefect 2
158
-
159
- # Benchmark multiple modules
160
- just benchmark-modules
161
-
162
- # Or use shell timing for quick single-run comparisons
163
- time ./scripts/perf_test.py numpy --depth 3
164
- time uvx pretty-mod tree numpy --depth 3
165
- ```
166
-
167
- Benchmark mode provides:
168
- - Warmup runs to account for cold starts
169
- - Multiple iterations for statistical significance
170
- - Mean, standard deviation, min/max timing statistics
171
- - Silent operation (no tree output) for accurate timing
172
-
173
- </details>
@@ -1,11 +0,0 @@
1
- pretty_mod-0.1.1.dist-info/METADATA,sha256=movybNjG8J0NDjqlx5jP-aa3zs_qBCykpWBjGSJbgZQ,5533
2
- pretty_mod-0.1.1.dist-info/WHEEL,sha256=aBacha0FcFMzjQuVTMCEUEJSXL9SWMbeMaJPxWjGHqE,92
3
- pretty_mod-0.1.1.dist-info/entry_points.txt,sha256=aNlomjGTypAOUeZiSZ4OYFY-QVq2KmDXkO9QFS45uW4,49
4
- pretty_mod-0.1.1.dist-info/licenses/LICENSE,sha256=J2cPHis9ZpzSonH9dVASFNtKrAdQmI-6qYBlivuubwA,1087
5
- pretty_mod/__init__.py,sha256=FWM2poN7eHWyVNly7AqU0RJlDHCrxhnk_k6LPFgyXcc,106
6
- pretty_mod/_pretty_mod.cp310-win32.pyd,sha256=uLjX40FPotBBgBJ0YewElJEX7qMleoYkyqynnrGgr3Q,5196288
7
- pretty_mod/_pretty_mod.pyi,sha256=BrQWGKmO3EgJvZkVI59zHRySbSy1snZpAhXc7LioXAc,661
8
- pretty_mod/cli.py,sha256=6-omiKcG5bDeDI696l6Lr7_vnpnMzsjxoz7c8g-j_oc,1525
9
- pretty_mod/explorer.py,sha256=3w-oY7edQzQMlAOVUSBqPJ94tiuJZXc45yD9bDHFsTs,268
10
- pretty_mod/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- pretty_mod-0.1.1.dist-info/RECORD,,