Socket
Book a DemoInstallSign in
Socket

treeline

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

treeline

Enhanced tree command with code structure analysis

1.0.1
pipPyPI
Maintainers
1

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

FlagDescription
directoryDirectory to analyze
--codeShow code structure (classes, functions, components)
--depth NLimit tree depth to N levels
--no-sizeHide size
--allShow all files
--include PATTERNInclude files matching pattern
--exclude PATTERNExclude files matching pattern
-o FILE, --output FILESave output
--file-countShow file and directory counts
--extensionsShow file extension

Author

Oha

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.