A tool to convert a project/folder/repo into one long markdown file for use with AI assistants
Project description
giftwrapy
giftwrapy (pronounced "gift-wrap-ee") is a Python tool that converts a project, folder, or repository into a single long markdown file. This is particularly useful for use with AI assistants, allowing you to easily share the structure and contents of your project.
Features
- Generates a tree structure of your project
- Includes file contents for specified extensions
- Allows ignoring specific directories and files
- Customizable output file name
- No dependencies outside of the Python standard library
Installation
You can install giftwrapy using pip:
pip install giftwrapy
Usage
After installation, you can use giftwrapy from the command line:
giftwrapy /path/to/your/project
For more options:
giftwrapy --help
Basic Usage Example
from giftwrapy import dir_to_markdown
dir_to_markdown(
directory=".",
extensions=[".py", ".html", ".sql", ".css", ".md"],
output_file="project_contents.md",
)
Command Line Options
directory: The path to the directory to convert.--extensions: List of file extensions to include (default: [".py", ".html", ".sql", ".css", ".md"]).--ignore-dirs: List of directory names or patterns to ignore.--ignore-files: List of file names or patterns to ignore.--use-default-ignore-pats: Whether to use the default ignore patterns (default: True).--output: Name of the output markdown file (default: "project_contents.md").
Default Ignore Patterns
giftwrapy uses default ignore patterns for both the tree structure and file contents. These include common directories and files like __pycache__, .git, .vscode, and others. You can add to these patterns using the --ignore-dirs and --ignore-files options.
Using with AI Assistants
giftwrapy is designed to make it easy to share your project structure and contents with AI assistants. Here's an example of how the output can be used:
This screenshot demonstrates how the markdown file generated by giftwrapy can be used in a conversation with an AI assistant, allowing for more context-aware and project-specific interactions.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for giftwrapy-0.3.0-py3-none-any.whl
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | ba59f24de6358da8ec2f1cb0cba5c2aad2614e4626e7db82b98da8e98ad54bf3 |
|
| MD5 | f688f10a741bfba4b2f1c9cec7b1857c |
|
| BLAKE2b-256 | 29bb56152fce4fd77750f580d0a1189f45b56dfe9d73288547cb1e7565e3766f |