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

  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.4.tar.gz (6.4 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.4-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: foldermap-0.1.4.tar.gz
  • Upload date:
  • Size: 6.4 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.4.tar.gz
Algorithm Hash digest
SHA256 cb8b7ae4ecedd92369b8a4583ae0d045c95f590a8a6b40efa9d1efa15aa1fb06
MD5 7f83ea1cfdfd8228834cb199d7bb3a11
BLAKE2b-256 293db627d4ed49ff3eba07f097213cb7daa77a8dfb77a126ec3fc0777184b2bd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: foldermap-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 6.5 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 17b9b3d523ade4ec43d57b75e89c775d9fbbeaeaecbcb2577193a56225b4b30c
MD5 dc748d5673838a9043996aa37fa534fe
BLAKE2b-256 a5c9491fbf14f847954a6d576329b8072a80650b473ee8e4d1b3ff7eb1b8999a

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