Skip to main content

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

Metadata

Release files for treeline 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for treeline 1.0.1
File Size Uploaded Provenance
treeline-1.0.1.tar.gz 10.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for treeline 1.0.1
File Interpreter ABI Platform
treeline-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.4 kB

Release files / treeline-1.0.1.tar.gz

Download URL treeline-1.0.1.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1e54216a0d017a672a8f2934e1f4d72ed2c299b8b96891b5eeee706056329d6b
BLAKE2b-256 checksum
How to use checksums
6c912df4239fa4a6c19db998f4e569ad761904f5159fbd8d2bbfa41dfadf6be3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.16

Release files / treeline-1.0.1-py3-none-any.whl

Download URL treeline-1.0.1-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ce1bf46bf4c3af5fb7af927fa1de78bf56abae2ed7c3c1e8fb5e209cd6ad34fd
BLAKE2b-256 checksum
How to use checksums
3ad8fa6fbc60e332d339e787b68f3fc177fc7b8b37621e4510e88b17ab29141e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.16

Security for treeline 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page