Skip to main content

A module tree explorer for humans and LLMs

Project description

pretty-mod

A module tree explorer for humans and LLMs.

Installation

uv add pretty-mod

Usage

from pretty_mod.explorer import ModuleTreeExplorer

# Explore a module structure  
explorer = ModuleTreeExplorer("json", max_depth=2)
print(explorer.get_tree_string())
Example output
๐Ÿ“ฆ json
โ””โ”€โ”€ ๐Ÿ“œ __all__: dump, dumps, load, loads, JSONDecoder, JSONDecodeError, JSONEncoder
โ”œโ”€โ”€ โšก functions: dump, dumps, load, loads
โ”œโ”€โ”€ ๐Ÿ“ฆ decoder
    โ”œโ”€โ”€ ๐Ÿ“œ __all__: JSONDecoder, JSONDecodeError
    โ”œโ”€โ”€ ๐Ÿ”ท classes: JSONDecodeError, JSONDecoder
โ”œโ”€โ”€ ๐Ÿ“ฆ encoder
    โ”œโ”€โ”€ ๐Ÿ”ท classes: JSONEncoder
    โ”œโ”€โ”€ โšก functions: py_encode_basestring, py_encode_basestring_ascii
โ”œโ”€โ”€ ๐Ÿ“ฆ scanner
    โ”œโ”€โ”€ ๐Ÿ“œ __all__: make_scanner
โ””โ”€โ”€ ๐Ÿ“ฆ tool
    โ””โ”€โ”€ โšก functions: main
from pretty_mod.explorer import display_signature

# Display function signatures
print(display_signature("json:loads"))
Example output
๐Ÿ“Ž loads
โ”œโ”€โ”€ Parameters:
โ”œโ”€โ”€ s
โ”œโ”€โ”€ cls = None (keyword-only)
โ”œโ”€โ”€ object_hook = None (keyword-only)
โ”œโ”€โ”€ parse_float = None (keyword-only)
โ”œโ”€โ”€ parse_int = None (keyword-only)
โ”œโ”€โ”€ parse_constant = None (keyword-only)
โ”œโ”€โ”€ object_pairs_hook = None (keyword-only)
โ””โ”€โ”€ kw (**kwargs)

CLI

Pretty-mod includes a command-line interface for quick exploration:

# Explore module structure
pretty-mod tree json
pretty-mod tree requests --depth 3

# Display function signatures  
pretty-mod sig json:loads
pretty-mod sig os.path:join

Examples

See the examples/ directory for more detailed usage patterns and advanced features.

Development

git clone https://github.com/zzstoatzz/pretty-mod.git
cd pretty-mod
uv sync
uv run pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pretty_mod-0.0.3.tar.gz (30.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pretty_mod-0.0.3-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file pretty_mod-0.0.3.tar.gz.

File metadata

  • Download URL: pretty_mod-0.0.3.tar.gz
  • Upload date:
  • Size: 30.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pretty_mod-0.0.3.tar.gz
Algorithm Hash digest
SHA256 b163f37f8b6a856dd627a451a3ea0d0264c200274a65d325821942ddcabd064d
MD5 845e4b3cb43906b5e19c2152ef978abf
BLAKE2b-256 1919e2065aa12e683be09e9da8c47fada08db8583c5c920de9945cf6d486934e

See more details on using hashes here.

File details

Details for the file pretty_mod-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: pretty_mod-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pretty_mod-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f4d9b4d8e317998615631ec174a11aa0328d9fe30a304142ccde556dedf7f24e
MD5 beb341b0ab515638829816b13032cf18
BLAKE2b-256 e7cc9f7c8064d289e0aa9bb098d27b3a0b3aa64c80ab0e4cc0aa811b63784bb8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page