Skip to main content

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

Project description

folder2md4llms

Tests Release Python 3.11+ License: MIT

folder2md4llms is a powerful and flexible tool that converts a repository's contents into a single, LLM-friendly Markdown file. It's designed to be fast, configurable, and easy to use, with a focus on producing high-quality, structured output.

✨ 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.
  • Fast and Efficient: Leverages multi-threading and efficient file processing to handle large repositories quickly.
  • Advanced Filtering: Uses .gitignore-style patterns to exclude files and directories.

🚀 Quick Start

Installation

# Using uv (recommended)
uv add folder2md4llms

# Using pip
pip install folder2md4llms

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.

🔧 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 Configuration Guide.

🛠️ 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.

📄 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.4.37.tar.gz (222.6 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.4.37-py3-none-any.whl (102.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for folder2md4llms-0.4.37.tar.gz
Algorithm Hash digest
SHA256 771ba69f2b6167cf47d4045e3387e442f9ee57200b7ed8809d7366218e603984
MD5 d6ffa90d5ac74b3bcbd22cd9067ddc4c
BLAKE2b-256 9000fe2f71b1b190c82bea70677c1aa5fa4a623408b2b25a68ddfb18e55b622f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for folder2md4llms-0.4.37-py3-none-any.whl
Algorithm Hash digest
SHA256 5fb9a35c1bffc26b0cad191c304e7198410e82dbee82816d7193440b25448e33
MD5 ab017da2160fcc14a9b85f719b9b3e99
BLAKE2b-256 1f2635b37a91e2fe9045e4958f97f699b2afb88356af580ffe7e1c86bac6cb99

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