Skip to main content

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:

Example usage with an AI assistant

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

giftwrapy-0.3.0.tar.gz (112.1 kB view details)

Uploaded Source

Built Distribution

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

giftwrapy-0.3.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file giftwrapy-0.3.0.tar.gz.

File metadata

  • Download URL: giftwrapy-0.3.0.tar.gz
  • Upload date:
  • Size: 112.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.13

File hashes

Hashes for giftwrapy-0.3.0.tar.gz
Algorithm Hash digest
SHA256 62ab978439000c76c6b920759244130733ce1d9fd1afadac4466b27ac974a5e7
MD5 5d41009dfc695a843ed456bf38cbdae9
BLAKE2b-256 5d3f1a9937a89cf5566e54b39b9f38c9e991840e6a4ccbf63a6abb660ac09d55

See more details on using hashes here.

File details

Details for the file giftwrapy-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: giftwrapy-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.13

File hashes

Hashes for giftwrapy-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba59f24de6358da8ec2f1cb0cba5c2aad2614e4626e7db82b98da8e98ad54bf3
MD5 f688f10a741bfba4b2f1c9cec7b1857c
BLAKE2b-256 29bb56152fce4fd77750f580d0a1189f45b56dfe9d73288547cb1e7565e3766f

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