Skip to main content

A tool to convert folder structures and file contents into markdown for LLMs

Project description

folder2md4llms

Tests Release PyPI version Python 3.11+ License: MIT Downloads

folder2md4llms is a configurable tool that converts a repository's contents into a single, LLM-friendly Markdown file. It supports various file formats and provides options for content condensing and filtering.

✨ Key Features

  • Smart Condensing: Automatically condenses code to fit within a specified token or character limit without crude truncation.
  • Document Conversion: Converts PDF, DOCX, XLSX, and other document formats into text.
  • Binary File Analysis: Provides intelligent descriptions for images, archives, and other binary files.
  • Highly Configurable: Use a folder2md.yaml file or command-line options to customize the output.
  • Parallel Processing: Uses multi-threading for processing multiple files concurrently.
  • Advanced Filtering: Uses .gitignore-style patterns to exclude files and directories.

🚀 Installation

# Using pipx (recommended)
pipx install folder2md4llms

# Or using pip
pip install folder2md4llms

# Verify installation
folder2md --help

Note: Package name is folder2md4llms, command is folder2md

Basic Usage

# Process the current directory and save to output.md
folder2md .

# Process a specific directory and set a token limit
folder2md /path/to/repo --limit 80000t

# Copy the output to the clipboard
folder2md /path/to/repo --clipboard

# Generate a .folder2md_ignore file
folder2md --init-ignore

For a full list of commands and options, see the CLI Reference or run folder2md --help.

🚨 Troubleshooting

Common Issues

"No matching distribution found for folder2md"

  • Use the correct package name: folder2md4llms (not folder2md)

"Command 'folder2md' not found"

  • Ensure pipx is installed: pip install pipx
  • Try: python -m folder2md4llms .

Platform-Specific Issues

Windows: Use WSL2 (Recommended)

For Windows users, we recommend using WSL2 (Windows Subsystem for Linux) for the best experience:

# Install WSL2 (run in PowerShell as Administrator)
wsl --install -d Ubuntu-22.04

# Then follow the Linux installation instructions in WSL2

This provides better compatibility and performance compared to native Windows installation.

Getting Help

  • Command help: folder2md --help
  • Version check: folder2md --version
  • Alternative: python -m folder2md4llms --help (works without installation)
  • Report issues: GitHub Issues
  • Discussions: GitHub Discussions

🔧 Configuration

You can configure folder2md4llms by creating a folder2md.yaml file in your repository's root directory. This allows you to set advanced options and define custom behavior.

For more details, see the CLI Reference.

🛠️ Development

Interested in contributing? Get started with these simple steps:

# Clone the repository
git clone https://github.com/henriqueslab/folder2md4llms.git
cd folder2md4llms

# Set up the development environment
make setup

# See all available commands
make help

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For more information, see the Contributing Guidelines.

📖 Documentation

📦 Distribution Channels

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

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

folder2md4llms-0.5.4.tar.gz (762.3 kB view details)

Uploaded Source

Built Distribution

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

folder2md4llms-0.5.4-py3-none-any.whl (120.7 kB view details)

Uploaded Python 3

File details

Details for the file folder2md4llms-0.5.4.tar.gz.

File metadata

  • Download URL: folder2md4llms-0.5.4.tar.gz
  • Upload date:
  • Size: 762.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for folder2md4llms-0.5.4.tar.gz
Algorithm Hash digest
SHA256 9b2de2053616aa72240782fcfe488d7c33f793132f91eb72e1952693f5738acb
MD5 ba79923ac6c9cc0384ecbaf830ddbf83
BLAKE2b-256 b05a3f46198a337f952a3ced4875ea5dabbbdffec59d3e4f98e5cbe3502fb8e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for folder2md4llms-0.5.4.tar.gz:

Publisher: release.yml on HenriquesLab/folder2md4llms

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file folder2md4llms-0.5.4-py3-none-any.whl.

File metadata

  • Download URL: folder2md4llms-0.5.4-py3-none-any.whl
  • Upload date:
  • Size: 120.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for folder2md4llms-0.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 cb2044cb0d8be7f33d1180298b45ee446b25d9bf9a59d3890f592fa8f5079146
MD5 2e004c98a87b85e8f531067ecbd671ca
BLAKE2b-256 ea40de8fadbaa6998d2d98d921d9c0c49ec6f2fa23fcd2492953e82378a95f6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for folder2md4llms-0.5.4-py3-none-any.whl:

Publisher: release.yml on HenriquesLab/folder2md4llms

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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