Skip to main content

Generate an ASCII folder structure of a directory

Project description

Branchify 🌳📂

TreeViz , which stands for Tree Visualizer, generates an ASCII folder structure from any directory. Works for Python>=3.4

Features

✅ Command-line Interface (CLI) & Python API
✅ Smart Ignoring of common directories and file types
✅ Explicit Inclusions for directories or file patterns
✅ Configurable File Limit


Installation

pip install branchify

CLI Usage

1️⃣ Generate a Folder Structure (Default)

branchify

2️⃣ Specify a Directory

branchify --path my_project

3️⃣ Ignore Specific Directories

branchify --ignore node_modules venv

4️⃣ Explicitly Include Some Directories or Files

branchify --include-dir logs --include-pattern '*.json'

5️⃣ Set a Custom File Limit

branchify --file-limit 5

6️⃣ Save Output to a File

branchify --output structure.txt

Python API Usage

from branchify import FolderStructureGenerator

generator = FolderStructureGenerator(root_dir="my_project", file_limit=5)
print(generator.generate())

With custom ignores:

ignores = {"directories": ["build"], "patterns": ["*.log"]}
generator = FolderStructureGenerator(root_dir="my_project", ignores=ignores, file_limit=3)
print(generator.generate())

Example Output

sample_project/
├── src/
│   ├── main.py
│   ├── utils.py
│   ├── config/
│   │   ├── settings.json
│   │   ├── defaults.yml
│   ├── __init__.py
├── README.md
└── tests/
    ├── test_main.py
    ├── test_utils.py
    └── ...

LICENSE

This project is licensed under the BSD 3-Clause License


Contributing

If you'd like to contribute to TreeViz, please open an issue or a pull request at the repository

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

branchify-0.1.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

branchify-0.1.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file branchify-0.1.0.tar.gz.

File metadata

  • Download URL: branchify-0.1.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for branchify-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0f9191994d6068556f5b8ed7d66b7772bc7e0b400a2eaa867640054689801cea
MD5 50506b411d9e4f07da2a438848006d6c
BLAKE2b-256 bec301345b89a475799708686ae29b8e934a8987dc6aa64223b05d61d19ab7db

See more details on using hashes here.

File details

Details for the file branchify-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: branchify-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for branchify-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e293ea87a9eb2ec8a5b60413083e97fb5adf1bf2d6e758d3ea98d8fa9aa0469
MD5 b199bb3e90784c881547f7bad6cf166c
BLAKE2b-256 5c46adda857d6f8d53aa344ab021b55f2d1646ad7f014a56594fe1f466616135

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