Generate Markdown-friendly folder trees for project documentation.
Project description
Folder Structure Generator
Generate clean Markdown folder trees for project documentation, README files, onboarding notes, and issue reports.
my-project/
|-- docs/
| `-- index.md
|-- src/
| `-- app.py
`-- README.md
Why use it?
- Simple Python API for generating project trees.
- Command-line interface for quick copy-and-paste output.
- Deterministic, sorted output for cleaner documentation diffs.
- Built-in ignores for common noise like
.git,__pycache__,venv,dist, andnode_modules. - No runtime dependencies.
Installation
pip install folder-structure-generator
For local development:
git clone https://github.com/ujjawalpoudel/folder-structure-generator.git
cd folder-structure-generator
python3 -m pip install -e .
Command-Line Usage
Generate a tree for the current directory:
folder-structure
Generate a tree for a specific project:
folder-structure path/to/project
Write the output to a file:
folder-structure path/to/project --output STRUCTURE.md
Useful options:
folder-structure --directories-only
folder-structure --exclude-hidden
folder-structure --max-depth 2
folder-structure --ignore migrations --ignore generated
folder-structure --no-default-ignore
The package also exposes folder-structure-generator as an alias command.
Python Usage
from folder_structure import FolderStructureGenerator
generator = FolderStructureGenerator(
ignored_folders=[".git", "__pycache__", "node_modules"],
max_depth=3,
)
tree = generator.generate("path/to/project")
print(tree)
You can also keep using the original method name:
tree = generator.generate_folder_structure_md("path/to/project")
API
FolderStructureGenerator(...)
Options:
ignored_folders: folder names or relative paths to exclude.include_files: include files in the generated tree. Defaults toTrue.include_hidden: include dotfiles and hidden directories. Defaults toTrue.max_depth: maximum folder depth below the root. Defaults to no limit.
generate(path=None)
Returns a Markdown-friendly tree for path. If path is not provided, it scans the current working directory.
Development
Run the test suite:
python3 -m unittest discover -s tests
Build the package:
python3 -m pip install build
python3 -m build
Contributing
Ideas, issues, and pull requests are welcome. Good first improvements include output format options, richer ignore patterns, and documentation examples for common project types.
See CONTRIBUTING.md for local setup, test commands, and release notes.
Repository: https://github.com/ujjawalpoudel/folder-structure-generator
Changelog
See CHANGELOG.md for release history.
License
Licensed under the Apache License 2.0. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file folder_structure_generator-0.1.0.tar.gz.
File metadata
- Download URL: folder_structure_generator-0.1.0.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02fcb4d1bab372d4d0f9ee7470e3ef441f161332382ef456dca9eb1d538f4241
|
|
| MD5 |
99f5bb6dcc375de3822eec2913e32e0b
|
|
| BLAKE2b-256 |
bce262b9deed050137e2ae0452e5024043b7e4d06c31166cc56f7274e1b61a53
|
File details
Details for the file folder_structure_generator-0.1.0-py3-none-any.whl.
File metadata
- Download URL: folder_structure_generator-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5424be79ec5bb480a1ef0ff1d30cc595a94d3c106af929b56c952a9ba928d245
|
|
| MD5 |
d416bd737131188bd525ea74084b9c7f
|
|
| BLAKE2b-256 |
9107b094fa1ec422a87656299cb3d0e6b4cb5775ac17c8ae79244a152c50794a
|