Skip to main content

Auto-generate code documentation in Markdown format in seconds.

Project description

ReadmeReady

codecov CI

Auto-generate code documentation in Markdown format in seconds.

What is ReadmeReady?

Automated documentation of programming source code is a challenging task with significant practical and scientific implications for the developer community. ReadmeReady is a large language model (LLM)-based application that developers can use as a support tool to generate basic documentation for any publicly available or custom repository. Over the last decade, several research have been done on generating documentation for source code using neural network architectures. With the recent advancements in LLM technology, some open-source applications have been developed to address this problem. However, these applications typically rely on the OpenAI APIs, which incur substantial financial costs, particularly for large repositories. Moreover, none of these open-source applications offer a fine-tuned model or features to enable users to fine-tune custom LLMs. Additionally, finding suitable data for fine-tuning is often challenging. Our application addresses these issues.

Installation

Install it from PyPI

The simplest way to install ReadmeReady and its dependencies is from PyPI with pip, Python's preferred package installer.

pip install readme_ready

In order to upgrade ReadmeReady to the latest version, use pip as follows.

$ pip install -U readme_ready

Install it from source

You can also install ReadmeReady from source as follows.

$ git clone https://github.com/souradipp76/ReadMeReady.git
$ cd ReadMeReady
$ make install

To create a virtual environment before installing ReadmeReady, you can use the command:

$ make virtualenv
$ source .venv/bin/activate

Usage

Initialize

$ export OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>
$ export HF_TOKEN=<YOUR_HUGGINGFACE_TOKEN>

Set OPENAI_API_KEY=dummy to use only open-source models.

Command-Line

$ python -m readme_ready
#or
$ readme_ready

In Code

from readme_ready.query import query
from readme_ready.index import index
from readme_ready.types import (
    AutodocReadmeConfig,
    AutodocRepoConfig,
    AutodocUserConfig,
    LLMModels,
)

model = LLMModels.LLAMA2_7B_CHAT_GPTQ # Choose model from supported models

repo_config = AutodocRepoConfig (
    name = "<NAME>", # Replace <NAME>
    root = "<PROJECT_ROOT>", # Replace <PROJECT_ROOT>
    repository_url = "<PROJECT_URL>", # Replace <PROJECT_URL>
    output = "<OUTPUT_DIR>", # Replace <OUTPUT_DIR>
    llms = [model],
    peft_model_path = "<PEFT_MODEL_NAME_OR_PATH>", # Replace <PEFT_MODEL_NAME_OR_PATH>
    ignore = [
        ".*",
        "*package-lock.json",
        "*package.json",
        "node_modules",
        "*dist*",
        "*build*",
        "*test*",
        "*.svg",
        "*.md",
        "*.mdx",
        "*.toml"
    ],
    file_prompt = "",
    folder_prompt = "",
    chat_prompt = "",
    content_type = "docs",
    target_audience = "smart developer",
    link_hosted = True,
    priority = None,
    max_concurrent_calls = 50,
    add_questions = False,
    device = "auto", # Select device "cpu" or "auto"
)

user_config = AutodocUserConfig(
    llms = [model]
)

readme_config = AutodocReadmeConfig(
    headings = "Description,Requirements,Installation,Usage,Contributing,License"
)

index.index(repo_config)
query.generate_readme(repo_config, user_config, readme_config)

Run the sample script in the examples/example.py to see a typical code usage.

Finetuning

For finetuning on custom datasets, follow the instructions below.

  • Run the notebook file scripts/data.ipynb and follow the instructions in the file to generate custom dataset from open-source repositories.
  • Run the notebook file scripts/fine-tuning-with-llama2-qlora.ipynb and follow the instructions in the file to finetune custom LLMs.

Contributing

ReadmeReady is an open-source project that is supported by a community who will gratefully and humbly accept any contributions you might make to the project.

If you are interested in contributing, read the CONTRIBUTING.md file.

  • Submit a bug report or feature request on GitHub Issues.
  • Add to the documentation or help with our website.
  • Write unit or integration tests for our project under the tests directory.
  • Answer questions on our issues, mailing list, Stack Overflow, and elsewhere.
  • Write a blog post, tweet, or share our project with others.

As you can see, there are lots of ways to get involved, and we would be very happy for you to join us!

License

Read the LICENSE file.

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

readme_ready-1.1.3.tar.gz (45.1 kB view details)

Uploaded Source

Built Distribution

readme_ready-1.1.3-py3-none-any.whl (29.4 kB view details)

Uploaded Python 3

File details

Details for the file readme_ready-1.1.3.tar.gz.

File metadata

  • Download URL: readme_ready-1.1.3.tar.gz
  • Upload date:
  • Size: 45.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for readme_ready-1.1.3.tar.gz
Algorithm Hash digest
SHA256 ba061d5419471ccb918b1238e1dfb5f405a96d741d59ecafeb99e60a3a3dfe40
MD5 167f4e4dc59635c1003618d012771f68
BLAKE2b-256 f818eb95d4817bcf7780c99a0305fb95d703ee3e9ca3ac4370ec2a8a1ceda764

See more details on using hashes here.

File details

Details for the file readme_ready-1.1.3-py3-none-any.whl.

File metadata

  • Download URL: readme_ready-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 29.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for readme_ready-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 30fc84b347008c4b0c6f5a8cb3625762af674d0b2c998beb4f54779c6d6d2ae8
MD5 ca8b2ff0da35e8c4fe494bdefdf97a75
BLAKE2b-256 79bd7ac523147d0386ca8b867895e578e2ddd16992e1505ed753ccae72980697

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page