Skip to main content

DirTree

一个简单易用的目录树显示工具。

功能特点

  • 显示目录的树形结构
  • 支持排除指定目录
  • 可以限制显示深度
  • 可以显示文件大小
  • 支持彩色输出和文件/文件夹图标
  • 显示统计信息(目录数、文件数、总大小)

安装

pip install dirview

使用方法

基本用法:

dirtree [路径] [选项]

选项说明:

  • -h, --help: 显示帮助信息
  • -e, --exclude: 要排除的目录列表 (例如: -e node_modules .git)
  • -L, --level: 最大显示深度 (例如: -L 2)
  • -s, --size: 显示文件大小
  • --version: 显示版本信息

使用示例:

# 显示当前目录的树结构
dirtree

# 显示指定目录的树结构
dirtree /path/to/directory

# 显示当前目录的树结构及文件大小
dirtree -s

# 只显示两层深度的目录结构
dirtree -L 2

# 排除指定目录
dirtree -e .git node_modules

输出示例:

目录树 for /your/project/path
==================================================
├── 📁 src/
│   ├── 📄 main.py
│   └── 📄 __init__.py
├── 📄 README.md
└── 📄 pyproject.toml

统计信息:
目录数: 1
文件数: 3
总大小: 2.5KB

默认排除的目录

工具默认会排除以下目录:

  • .git
  • pycache
  • node_modules
  • langchain-env

许可证

MIT License

作者

陈定钢 (945036663@qq.com)

贡献

欢迎提交 Issue 和 Pull Request!

更新历史

0.1.1

  • 初始发布
  • 实现基本的目录树显示功能
  • 添加文件大小显示功能
  • 添加目录排除功能
  • 添加深度限制功能

Metadata

Release files for dirview 0.1.5

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

Source distribution (sdist)

Source distribution for dirview 0.1.5
File Size Uploaded Provenance Actions
dirview-0.1.5.tar.gz 5.3 kB Without provenance Details for dirview-0.1.5.tar.gz

Built distribution (wheel)

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

Total release size: 11.1 kB

Release files / dirview-0.1.5.tar.gz

Download URL dirview-0.1.5.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
dadf742832b4ac6bd79a90e92e16c5a6ea4a87f7c064183014ac6301a97040ae
BLAKE2b-256 checksum
How to use checksums
1f3c8ea8378d4369d3bfd5ada85173607796a38b463377b1d49bd203e6e0d15c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Release files / dirview-0.1.5-py3-none-any.whl

Download URL dirview-0.1.5-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
36f3911a6fc01c785e5c838eb23d796a86b8ea5bd8d5babccb9cea8b859393cd
BLAKE2b-256 checksum
How to use checksums
82a75e436c2d58697e517d8e9a70c8f95147c68557f6fce8195a2e2192e90a75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Security for dirview 0.1.5

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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