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

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

Python API

from foldermap import collect_files, get_folder_structure, generate_markdown

# 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 markdown report
generate_markdown("your/folder/path", files, structure, "output.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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: foldermap-0.1.0.tar.gz
  • Upload date:
  • Size: 6.1 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.0.tar.gz
Algorithm Hash digest
SHA256 9f72c752343f47d345a35be6c70a9b3f30c30a0c983c0c05a18d5f3eeb137f8e
MD5 c736473c9cb540b997a7608eaf81e5b0
BLAKE2b-256 8f765875824116978a0a4220c44a08284e84190b1451b7a39ba21ebbee715926

See more details on using hashes here.

File details

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

File metadata

  • Download URL: foldermap-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7ec9930782bd867d29e461730d1276d29d2fea5532911b57a0e62397ca48aca
MD5 30dd3df01e69b3cb67a9f26bbe8983d2
BLAKE2b-256 e9b7f0b526573c9ed579bc5aedf2ee2f5a4399d7e72abf5874158e82654e0fa9

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