Skip to main content

LLM-based library to auto-generate docstrings for Python scripts and modules.

Project description

pydocify - LLM-Based Documentation Generator Library for Python Code

Author : Rahul Bhoyar

pydocify is a library that uses a language model (LLM) to generate and add documentation strings (docstrings) for Python scripts, functions, and classes. This is especially useful for maintaining code readability and consistency in projects with minimal documentation.

Features

  • Automatically generates docstrings based on code content.
  • Archives original Python files before documentation is added.
  • Recursively processes all Python files in a specified directory.
  • Supports deleting archive files created during the documentation process.

Installation

Install pydocify with pip:

pip install pydocify

Usage

1. Documenting All Python Files in a Directory

Use the DirectoryStringGenerator class to recursively document all Python files in a specified directory:

from pydocify.core import DirectoryStringGenerator

doc_generator = DirectoryStringGenerator()
doc_generator.generate("/path/to/your/directory")

2. Deleting Archive Files during documentation process

Use delete_archives to remove any archive files created during the documentation process:

doc_generator.delete_archives("/path/to/your/directory")

Requirements

Ensure that you have your OPENAI_API_KEY set up as an environment variable in a .env file.

License

pydocify is licensed under the MIT License.

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

pydocify-0.1.6.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

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

pydocify-0.1.6-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file pydocify-0.1.6.tar.gz.

File metadata

  • Download URL: pydocify-0.1.6.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.8rc1

File hashes

Hashes for pydocify-0.1.6.tar.gz
Algorithm Hash digest
SHA256 15f3f4a7f899d98a1fe2d0411a98e5469e530df31be01ab7808ab27942b48e86
MD5 6431f80337c6b43f9b28338592111619
BLAKE2b-256 76a629d42cff572fe9d8927aca9459d1e25e6539b2d1881b97798885632a1fa0

See more details on using hashes here.

File details

Details for the file pydocify-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: pydocify-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.8rc1

File hashes

Hashes for pydocify-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 6d01afd28fdb0a0fa17b789960d5f8b8f1ab232e58a7b651b1c105008a2ac770
MD5 8b6c969eeb1d3fe6e2a3e733835bad39
BLAKE2b-256 c82b77b7e65e7f522ec8746e6eb6501eed183bca79cc1f9e717ff5f6985ac188

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