Skip to main content

AST-based code structure outline tool — generate hierarchical symbol maps with call relationships

Project description

codetre

AST-based code structure tree tool.

Extracts classes, functions, methods and their call relationships into a clean hierarchical view. Uses ast-grep for AST-level accuracy across multiple languages.

Requirements

  • Python ≥ 3.10
  • ast-grep (sg) installed and on PATH

Installation

pip install codetre

Usage

# Scan current directory
codetre

# Scan specific directory
codetre src/

# Scan single file
codetre src/main.py

Supported Languages

Python, JavaScript, TypeScript, Go, C, C++, Java, Rust, Ruby, Kotlin, Scala, C#, PHP, Swift, Lua, Bash, and more.

Output Example

file: src/services/auth.py
  class AuthService:9~40
    func login:14~20  -> call[_generate_token, _verify_password]
    func validate_token:22~30
    func logout:32~34

file: src/main.py
  class App:8~39
    func register_user:15~19
    func place_order:21~30  -> call[validate_token, create_order, approve_order]

License

MIT

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

codetre-0.2.1.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

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

codetre-0.2.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file codetre-0.2.1.tar.gz.

File metadata

  • Download URL: codetre-0.2.1.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for codetre-0.2.1.tar.gz
Algorithm Hash digest
SHA256 9cb827d6125302ef8e0f0ee5bb5c3c93fae079f70b693f202c0cbefd6504c645
MD5 9ba878f50290327a8f29b8a4ebe63195
BLAKE2b-256 e621f51c55c071bb5f95bf2553913e4da8dc6d53ce2cbf8c33baabd8df37021d

See more details on using hashes here.

File details

Details for the file codetre-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: codetre-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for codetre-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2e78f24036f05035d8b30d392d214ec2cc6d7a68ab705b6a7ba406e1c57d6a23
MD5 c3e803524d75f65267421886f898f239
BLAKE2b-256 dec1f15cc66f8807b992a1594a41256326d23085ad95f40d16b6b9019676410a

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