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 Documentation : Check out the documentation here: https://pypi.org/project/branchify/

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

7️⃣ Update Branchify to the latest version

branchify --update

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())

Sample Usage


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 Branchify, 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-1.0.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

branchify-1.0.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for branchify-1.0.0.tar.gz
Algorithm Hash digest
SHA256 360df77b089dd35520810c0bfdf56eba769c79d7aaed2f34bab0c1b8973f3f52
MD5 5564a95816b822655ad5031eb2dce60a
BLAKE2b-256 a5a233f33b257645af17be36453524d9e56125e4c9f6e2c0c98a7c04d825eef7

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for branchify-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa07497228b6b3b8e48a01083b18151e8248888082a87df1c7b004b7c9b1a375
MD5 fb0ed5ce77d732a6b385378040a8cc3d
BLAKE2b-256 0bd88899a887ff3c489423a9e5ec8b41c85a23172a751f81ca0abefa01fcd0e8

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