Skip to main content

Generate a README from your project files using LLM

Project description

Docufy: Automated README Generation with Gemini Pro

Docufy is a command-line tool designed to automatically generate comprehensive README files for your software projects using the power of Google's Gemini Pro model. It analyzes your project's source code and creates a well-structured README, saving you time and effort in documenting your work.

Installation

  1. Install the package:

    pip install docufy
    
  2. Set up your Gemini API key:

    You'll need a Google Gemini API key to use Docufy. You can provide it in one of two ways:

    • Using the --apikey flag when running Docufy.
    • Setting the GEMINI_API_KEY environment variable.

Usage

To generate a README for your project, run the following command:

docufy --path <project_path> --out <output_path> --apikey <your_api_key>
  • <project_path>: The path to your project's root directory.
  • <output_path>: The desired path for the generated README file (e.g., README.md). Defaults to README.md in the current directory if not provided.
  • <your_api_key>: Your Google Gemini API key.

Example:

docufy --path my_project --out README.md --apikey AIzaSy...

Optional Arguments:

  • --include <extensions>: Specify file extensions to include in the analysis (e.g., .py, .js). Defaults to .py. Use multiple --include flags to include multiple extensions.
  • --exclude <files/folders>: Specify files or folders to exclude from the analysis (e.g., __init__.py, tests/). Use multiple --exclude flags to exclude multiple files or folders.
  • --model <model_name>: Specify the Gemini model to use. Defaults to gemini-2.0-flash.

Features Overview

  • Automated README Generation: Generates a comprehensive README file based on your project's source code.
  • Gemini Pro Integration: Leverages the power of Google's Gemini Pro model for intelligent summarization and documentation.
  • Customizable Inclusion/Exclusion: Control which files and folders are included or excluded from the analysis.
  • .readmeignore Support: Uses a .readmeignore file (similar to .gitignore) to specify files and folders to exclude.
  • Clear and Concise Output: Generates a well-structured README in Markdown format.

File Structure Summary

  • docufy/generate_readme.py: Contains the core logic for generating the README file. This file handles file processing, summarization using Gemini Pro, and output formatting.
  • docufy/__init__.py: Defines the command-line interface using argparse and orchestrates the README generation process.

Configuration

The .readmeignore File

Docufy uses a .readmeignore file in your project's root directory to specify files and folders that should be excluded from the README generation process. The .readmeignore file follows the same syntax as .gitignore.

Example .readmeignore:

# Ignore dependency directories
node_modules/
.venv/

# Ignore log files
*.log

# Ignore test files
tests/

Docufy automatically creates a default .readmeignore file in your project's root directory if one doesn't exist. This file includes common exclusions like dependency directories, build outputs, and log files. You can customize this file to refine your exclusions.

Important Notes

  • Ensure your Gemini API key is properly configured.
  • The quality of the generated README depends on the clarity and structure of your source code.
  • Consider reviewing and editing the generated README to ensure accuracy and completeness.

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

docufy-1.2.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

docufy-1.2.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file docufy-1.2.0.tar.gz.

File metadata

  • Download URL: docufy-1.2.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for docufy-1.2.0.tar.gz
Algorithm Hash digest
SHA256 0881c914909b4e28040d0c602ad5979340b1c5aa19d28537d698a772c67b0e49
MD5 53191b15ab4fa73935e1698ab9677eb9
BLAKE2b-256 f00f28dde0a7853660a27b3d3bb4f0f9f3f9cc035b2a65b0b0f1a16688a4ffcf

See more details on using hashes here.

File details

Details for the file docufy-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: docufy-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for docufy-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9927c1687ac1678cfd94e8d17002ed0cc8ab95b0cc3b02d4d31f3fb9ed60d611
MD5 40e6c2989bf1d283355d357824fc202b
BLAKE2b-256 7bf9886e8a318929b73ffd9dc6dbb224c9d2544a64fde7015927ac879714995c

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