Skip to main content

Project structure tree visualizer with Python AST analysis and change tracking

Project description

Trellis

Project structure tree visualizer with Python AST analysis and change tracking.

Trellis scans a directory tree and produces a text representation that includes Python classes, functions, signatures, decorators, and call flow analysis. It tracks structural changes between runs and generates categorized change summaries with timestamped log files.

Installation

pip install ks-trellis

Quick Start

Run from any directory inside a project. Trellis auto-discovers the project root by walking upward looking for .git, pyproject.toml, and other markers.

trellis

Output is saved to docs/{project}_structure.txt. On subsequent runs, trellis detects and reports structural changes.

Output Example

project/ [pkg] [cmd] [typed]
├── core/ [pkg]
│   ├── models.py {85}
│   │   ├── class BaseProcessor  :5
│   │   ├── class DataStore(BaseProcessor)  :20
│   │   │   ├── def connect(host: str, port: int) -> None  :25
│   │   │   └── def query(sql: str) -> list[dict]  :34
│   │   └── def build_config(path: str) -> Config  :60
│   └── utils.py {42}
│       ├── /wrapper\ def cached_lookup(func)  :10
│       └── def format_output(items: list) -> str  :18
├── handlers.py {120}
│   ├── @app.route('/api')
│   │   └── def handle_request(request: Request) -> Response  :15
│   └── def process_data(input: str, limit: int) -> Result  :45
└── main.py {30}
    └── def main() -> int  :8
        └── calls: build_config -> process_data -> run


# tr_meta:D1I1F1T1@1C0P1V0U0S0Wsmart

Markers: [pkg] = Python package, [cmd] = has __main__.py, [typed] = has py.typed

Line counts: {85} = 85 lines of source code

Call flow: calls: build_config -> process_data -> run shows orchestration function call chains (SMART mode filters for high-signal calls)

Wrapper collapse: /wrapper\ tags decorator boilerplate that wraps a single inner function

CLI Flags

trellis --show-private          # include _private members
trellis --show-dunder           # include __dunder__ methods
trellis --show-all              # show everything
trellis --hide-all              # hide private/dunder/mangled, disable call flow
trellis --call-flow raw         # show all calls without filtering
trellis --call-flow off         # disable call flow display
trellis --hide-types            # omit type annotations
trellis --hide-decorators       # omit decorator rendering

See CLI Reference for the full flag list.

Documentation

License

See LICENSE.

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

ks_trellis-1.3.2.tar.gz (86.6 kB view details)

Uploaded Source

Built Distribution

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

ks_trellis-1.3.2-py3-none-any.whl (64.2 kB view details)

Uploaded Python 3

File details

Details for the file ks_trellis-1.3.2.tar.gz.

File metadata

  • Download URL: ks_trellis-1.3.2.tar.gz
  • Upload date:
  • Size: 86.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for ks_trellis-1.3.2.tar.gz
Algorithm Hash digest
SHA256 1a88585da2dc76dbc89e9f4b3545f275672565ae3dc8a4972c83829ab468220a
MD5 81f392e7ce20326d07e36892df958c66
BLAKE2b-256 12cc734c3a8e21e384333d87e868166a384ce648a26e0c5d0fa8a3a29fdf6fb3

See more details on using hashes here.

File details

Details for the file ks_trellis-1.3.2-py3-none-any.whl.

File metadata

  • Download URL: ks_trellis-1.3.2-py3-none-any.whl
  • Upload date:
  • Size: 64.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for ks_trellis-1.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f9eef953573da0ada2de1c9a9e16805772bd6b0bd588b5bf972062e588f4e66b
MD5 d5c5171f5a9a9aa11765c88bbf956ffc
BLAKE2b-256 df0977f6dc02e214e203a2a9be0012490e1f7db53ee0114f51513ad0663aba74

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