Skip to main content

Generate an ASCII folder structure of a directory

Project description

Branchify 🌳📂

Branchify 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.1.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.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: branchify-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 f7b476ca45001392ce98dfede1c2dd818087b590bbaed564a2ace588bd651009
MD5 71940d55a409ce2e4008d453848368ef
BLAKE2b-256 dfe6fe509cd619a42f3cb1620c5bfde52e926020f8c7f827e4b912e0700f6ebc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: branchify-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 31c78a21fc114292bc64f7098d778feb6b0300004cd6f8753ab4434daf9783c5
MD5 d10719105481ac22f53071bcaaa7af03
BLAKE2b-256 17bdeb059039b97e46eaf0e6b68f43c90d2c3f2965381724e47b8dec20d4aa51

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