codergpt.commenter package

Submodules

codergpt.commenter.commenter module

Commenter Module.

class codergpt.commenter.commenter.CodeCommenter(chain)

Bases: object

Code Explainer class that extracts and explains code from a given file.

comment(code, filename, overwrite=False, language=None)

Comment the contents of the code string by invoking the runnable chain and write it to a new file.

Parameters:
  • code (str) – The string containing the code to be commented.

  • filename (str) – The original filename of the code file.

  • overwrite (bool) – A boolean indicating whether to overwrite the original file. Default is False.

  • language (Optional[str]) – Coding language of the file, defaults to None

Module contents

Commenter module for the package.

class codergpt.commenter.CodeCommenter(chain)

Bases: object

Code Explainer class that extracts and explains code from a given file.

comment(code, filename, overwrite=False, language=None)

Comment the contents of the code string by invoking the runnable chain and write it to a new file.

Parameters:
  • code (str) – The string containing the code to be commented.

  • filename (str) – The original filename of the code file.

  • overwrite (bool) – A boolean indicating whether to overwrite the original file. Default is False.

  • language (Optional[str]) – Coding language of the file, defaults to None