Skip to main content

Enhanced tree command with code structure analysis

Project description

treeline

Treeline Logo

A Python toolkit for generating directory trees. Treeline helps developers understand codebases through ASCII tree representations.

Installation

pip install treeline

Usage

Command Line

treeline  
treeline /path/to/project

treeline --code
treeline --code --depth 2

treeline --include "*.py"
treeline --exclude "node_modules"
treeline --all

treeline --no-size
treeline --file-count
treeline --output tree.txt

Python Library

from treeline import tree, TreeRenderer

# eg1
tree("./my_project", show_code_structure=True)

# eg2
renderer = TreeRenderer(
    show_code_structure=True,
    max_depth=3,
    show_size=True,
    output_file="structure.txt"
)
renderer.render("./my_project")

Supported Languages

  • Python (.py) - Classes, functions, methods with full AST parsing
  • JavaScript (.js, .mjs) - Classes, functions, modules
  • TypeScript (.ts) - Classes, functions, interfaces
  • React (.jsx, .tsx) - Components (both class and functional), hooks

Options

Flag Description
directory Directory to analyze
--code Show code structure (classes, functions, components)
--depth N Limit tree depth to N levels
--no-size Hide size
--all Show all files
--include PATTERN Include files matching pattern
--exclude PATTERN Exclude files matching pattern
-o FILE, --output FILE Save output
--file-count Show file and directory counts
--extensions Show file extension

Author

Oha

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

treeline-1.0.1.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

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

treeline-1.0.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file treeline-1.0.1.tar.gz.

File metadata

  • Download URL: treeline-1.0.1.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for treeline-1.0.1.tar.gz
Algorithm Hash digest
SHA256 1e54216a0d017a672a8f2934e1f4d72ed2c299b8b96891b5eeee706056329d6b
MD5 b8ba45da37ccab2ebe3b30ed9456d54f
BLAKE2b-256 6c912df4239fa4a6c19db998f4e569ad761904f5159fbd8d2bbfa41dfadf6be3

See more details on using hashes here.

File details

Details for the file treeline-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: treeline-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for treeline-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ce1bf46bf4c3af5fb7af927fa1de78bf56abae2ed7c3c1e8fb5e209cd6ad34fd
MD5 a568ff88406e1d0167ee60c24ee5f053
BLAKE2b-256 3ad8fa6fbc60e332d339e787b68f3fc177fc7b8b37621e4510e88b17ab29141e

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