Skip to main content

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

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

# Combine options
foldermap /path/to/folder -o report.md -e py,txt -x node_modules,venv -s

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
)

# 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:

  1. A timestamp of when the report was generated
  2. The absolute path of the base folder
  3. A visual tree structure of all folders and files
  4. 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.3.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

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

foldermap-0.1.3-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file foldermap-0.1.3.tar.gz.

File metadata

  • Download URL: foldermap-0.1.3.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for foldermap-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a9aa86e33379011e0eee7e8c81352058771b301f29876620d55c996b93ebf047
MD5 35a2b219bf024056b7b34898d6334bc9
BLAKE2b-256 e4e3762f6da85ad915fbd5021a73ab3b506b3e5ae85c7cb1270231bba0414242

See more details on using hashes here.

File details

Details for the file foldermap-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: foldermap-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for foldermap-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 78dc9caf5ccd621c98c1d86121977a4963d5aee432e151ebe0f0bf6f1bbf6218
MD5 83324ecda7e30ca20180d62b2ff18073
BLAKE2b-256 7db91335e1e0c15b1a0054e7826ae5e6e423fc056eeb66c6725198bed66307fc

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