A tool for mapping files and folders to markdown documentation
Project description
Foldermap
Foldermap is a utility that collects files from a directory, creates a visual tree structure, and generates a comprehensive markdown report with all the file contents.
Features
- Collect files from directories and subdirectories
- Filter files by extension
- Exclude specific folders
- Generate folder structure visualization
- Create markdown reports with file contents
- Generate structure-only reports (without file contents)
- Simple command-line interface
- Option to include/exclude hidden folders (starting with .)
Installation
pip install foldermap
Usage
Command Line
# Basic usage
foldermap /path/to/folder
# Specify output file
foldermap /path/to/folder -o report.md
# Filter files by extension
foldermap /path/to/folder -e py,txt,md
# Exclude specific folders
foldermap /path/to/folder -x node_modules,.git,venv
# Generate structure-only report (without file contents)
foldermap /path/to/folder -s
# Include hidden folders (starting with .)
foldermap /path/to/folder --include-hidden
# Combine options
foldermap /path/to/folder -o report.md -e py,txt -x node_modules,venv -s --include-hidden
Python API
from foldermap import collect_files, get_folder_structure, generate_markdown, generate_structure_only
# Collect files from a directory
files = collect_files(
folder_path="your/folder/path",
extensions=[".py", ".txt"], # Optional
exclude_folders=["venv", ".git"], # Optional
include_hidden=False # Optional, default is False
)
# Generate folder structure
structure = get_folder_structure("your/folder/path", files)
# Generate complete markdown report with file contents
generate_markdown("your/folder/path", files, structure, "output.md")
# Generate structure-only report (without file contents)
generate_structure_only("your/folder/path", structure, "structure.md")
Example Output
The generated markdown file includes:
- A timestamp of when the report was generated
- The absolute path of the base folder
- A visual tree structure of all folders and files
- The content of each file, formatted as code blocks (for complete reports)
Example folder structure:
📄 README.md
📁 foldermap
📄 __init__.py
📄 core.py
📄 cli.py
📁 tests
📄 test_foldermap.py
License
MIT License
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
foldermap-0.1.6.tar.gz
(7.8 kB
view details)
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 foldermap-0.1.6.tar.gz.
File metadata
- Download URL: foldermap-0.1.6.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d02e5ea6f42b2fd5ad90d1c98354f226f505544c6d2f4938417a1bd52b253083
|
|
| MD5 |
182df1557ad8d8e3ce135630953e886f
|
|
| BLAKE2b-256 |
41a75ced06a559a668cb04f9b0335e900ed9175b50d83ca04014e9aefb64ce0c
|
File details
Details for the file foldermap-0.1.6-py3-none-any.whl.
File metadata
- Download URL: foldermap-0.1.6-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8866e179664becb4b735d4380515fdfa5d54935c3018e39c418999a4f18ec941
|
|
| MD5 |
13d4ecf2b38de53afea0e4fa1bf1dd65
|
|
| BLAKE2b-256 |
53eb1c01adab4029a40a03cb12f7c033beba76d43283d33d10220923d5bfc2d9
|