Skip to main content

A lightweight Python library and CLI tool for displaying visually structured directory trees with optional emoji and exclusion filters.

Project description

๐Ÿ“๐ŸŒณ wintree

wintree is a Python library that displays the hierarchical structure of a specified directory in a tree format. It can be easily used from the command line, supports visually appealing tree views with emojis, and allows you to specify directories to exclude.

๐Ÿš€ Usage

๐Ÿ“š๏ธ As a Library

import wintree

wintree.print_tree()
# sample output
๐Ÿ“‚ root: .
โ”œโ”€โ”€ ๐Ÿ“„ .gitignore
โ”œโ”€โ”€ ๐Ÿ“„ README.md
โ”œโ”€โ”€ ๐Ÿ“„ pyproject.toml
โ”œโ”€โ”€ ๐Ÿ“ src/
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ assets/
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ icon.png
โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ“„ splash_android.png
โ”‚   โ””โ”€โ”€ ๐Ÿ“„ main.py
โ””โ”€โ”€ ๐Ÿ“ storage/
    โ”œโ”€โ”€ ๐Ÿ“ data/
    โ””โ”€โ”€ ๐Ÿ“ temp/

With arguments:

from wintree import print_tree

print_tree(root_dir="/path/to/project", use_emoji=True, ignore_dirs=[".git", "__pycache__"])
Argument Type Description
root_dir str Path to the root directory to start displaying the tree. Default is the current directory "."
use_emoji bool Whether to use emojis in the tree view. If True, adds icons to folders and files.
ignore_dirs List[str] List of directory names to exclude from the tree (partial match). Example: [".git", "node_modules"]

โš™๏ธ Usage from CLI

python -m wintree.cli /path/to/project --exclude .git __pycache__

Options

Option Description
path Path to the root directory
--no-emoji Disable emoji display
--exclude Specify directory names to exclude (partial match, space-separated)

๐Ÿ“Œ Features

  • Emoji-based tree view for better visibility
  • Flexible exclusion of target directories
  • Supports Windows/macOS/Linux
  • Pure Python, no external dependencies

๐Ÿงช For Developers

This library can also be used as a base for directory visualization tools. Integration with GUI tools or IDE plugins is also possible.

๐Ÿ“„ License

MIT License

๐ŸŒ Language

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

wintree-0.1.3.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

wintree-0.1.3-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file wintree-0.1.3.tar.gz.

File metadata

  • Download URL: wintree-0.1.3.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.0 Windows/11

File hashes

Hashes for wintree-0.1.3.tar.gz
Algorithm Hash digest
SHA256 7ede6d17541da4136632912f1eb3553a861e3684827a2e3f635e8194eabb431a
MD5 e50a7d2b47ebfdf096d131b368da7047
BLAKE2b-256 1b1869eb3fc3367f2180880d9e0d267f6529c945fcfc7130776a93d672d0dcd4

See more details on using hashes here.

File details

Details for the file wintree-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: wintree-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.0 Windows/11

File hashes

Hashes for wintree-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a6ca3ab2086fa3cfa5278cf1eadc6f8f5ebaa478fc9045ec5b401280a9f2ec2b
MD5 fe68fa89908449a9d4a7a20f2fb062d2
BLAKE2b-256 67eae092f716245751ce1cd6b6e8071e2bcd9661932502552daf9d04497ccd0f

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