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.0.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.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for treeline-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c2380694dbfce183f5401c69e4f0b65cc9a55462fcf44d2fcc17fce9bd23a8b7
MD5 8f188101caa60c5277c2cdc302a95a2d
BLAKE2b-256 3e7ac302347ba64acd6f462b78dd0cabeeee1a91c2276f0f2139ba403bb7e52f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: treeline-1.0.0-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.9.6

File hashes

Hashes for treeline-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 985662ffc3fd386962e77977f60e07ed1b2d7bf634b15eb817fd14734dbfcb2d
MD5 aaf788bff0365b20e03fe37fec291dfd
BLAKE2b-256 5c1360204546c8934436e62f073adf303807b8271e3ecbb393d604b50dec8d8d

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