Skip to main content

A module tree explorer for humans and LLMs

Project description

pretty-mod

A module tree explorer for humans and LLMs.

ยป uvx pretty-mod tree json
๐Ÿ“ฆ 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

ยป uvx pretty-mod sig json:dumps
๐Ÿ“Ž dumps
โ”œโ”€โ”€ Parameters:
โ”œโ”€โ”€ obj
โ”œโ”€โ”€ skipkeys = False (keyword-only)
โ”œโ”€โ”€ ensure_ascii = True (keyword-only)
โ”œโ”€โ”€ check_circular = True (keyword-only)
โ”œโ”€โ”€ allow_nan = True (keyword-only)
โ”œโ”€โ”€ cls = None (keyword-only)
โ”œโ”€โ”€ indent = None (keyword-only)
โ”œโ”€โ”€ separators = None (keyword-only)
โ”œโ”€โ”€ default = None (keyword-only)
โ”œโ”€โ”€ sort_keys = False (keyword-only)
โ””โ”€โ”€ kw (**kwargs)

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

# inspect libraries you don't have installed
uvx --with fastapi pretty-mod tree fastapi.routing

uvx --with fastapi pretty-mod sig fastapi.routing:run_endpoint_function

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.4.tar.gz (31.0 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.4-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pretty_mod-0.0.4.tar.gz
  • Upload date:
  • Size: 31.0 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.4.tar.gz
Algorithm Hash digest
SHA256 1afd6cc24e79b6608cf4b5c34e07d69498af070074d99473a9b9f4dae964b95b
MD5 a44e2374699710696f8dd248e078fb93
BLAKE2b-256 00cd9f145a8a8a03a33f5e779c16a5bb0910096b912505fee2bb99c301ba7b1c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pretty_mod-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 6.8 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 88f708427ed66414e66baae5c7d4dbf3637a3bef1a87f3b555aa6146b5a98b31
MD5 a293cbb284887aa2cf7ff37f043b0dbb
BLAKE2b-256 22f1008a840531177f3b78988746602835e8c93c9e033316b3ccf70fff4ff780

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