Skip to content

UBC-MDS/FML_doc_generator

Repository files navigation

fml_doc_generator

doc string generator

Summary

fml_doc_generator is a Python package designed to simplify the process of writing docstrings for user-defined functions. It offers an automated way to generate docstring templates or fully detailed docstrings through integration with the OpenAI API. By streamlining documentation, it helps developers save time, improve code readability, and maintain consistent documentation standards across projects.

Functions Included

  • generate_docstring_template(func: Callable, auto_generate: bool = False, output_file: str = None) -> str: The main end-user function that generates either a docstring template with placeholders or a fully detailed docstring if auto_generate is set to True.

  • read_user_function(func: Callable) -> str: Reads and extracts the signature and existing docstring (if any) of a given user-defined function.

  • generate_template(func_signature: str) -> str: Creates a docstring template with placeholders for parameters, return values, and a brief description based on the function signature.

  • write_docstring_to_file(docstring: str, output_file: str) -> None: Writes the generated docstring to a specified file.

Python Ecosystem

fml_doc_generator fits into the Python ecosystem as a specialized tool for automating function documentation. While other Python packages like sphinx and pydoc exist for generating documentation from docstrings, there are no widely known packages that automatically generate docstrings themselves using AI. This makes fml_doc_generator unique in its approach by leveraging OpenAI's capabilities to produce high-quality docstrings with minimal effort from the developer.

If you are aware of a similar tool, feel free to contribute to our documentation by suggesting it!

Authors

Farhan Bin Faisal, Michael Suriawan, Lukman Lateef

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

fml_doc_generator was created by Farhan Faisal, Lukman Lateef, and Michael Suriawan. It is licensed under the terms of the MIT license.

Credits

fml_doc_generator was created with cookiecutter and the py-pkgs-cookiecutter template.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages