doc string generator
Project description
fml_doc_gen
| Documentation | |
| Testing | |
| Package | |
| Downloads | |
| Supported Versions |
Authors
- Farhan Bin Faisal trying release_token
- Michael Suriawan
- Lukman Lateef
Summary
fml_doc_gen 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.
Installation
$ pip install fml_doc_gen
Usage
generate_docstring_template can be used to generate docstring template for your function shown below:
import fml_doc_gen
from fml_doc_gen.fml_doc_gen import generate_docstring_template
def square(base: int, pow: int) -> int:
return base ** pow
print(generate_docstring_template(square, output_file=None))
Functions Included
-
generate_docstring_template(func: Callable, output_file: str, auto_generate: bool = False) -> str: The main end-user function that generates either a docstring template with placeholders or a fully detailed docstring ifauto_generateis set toTrue. -
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_gen 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_gen 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!
Discussion and Improvements
Found a bug? or have an idea on how to improve fml_doc_gen further? Feel free to open an issue with the appropriate label (bug or features) under the issue section here.
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_gen was created by Farhan Faisal, Lukman Lateef, and Michael Suriawan. It is licensed under the terms of the MIT license.
Credits
fml_doc_gen was created with cookiecutter and the py-pkgs-cookiecutter template.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fml_doc_gen-3.0.3.tar.gz.
File metadata
- Download URL: fml_doc_gen-3.0.3.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b07868e03914a7147cac15da2cc051cd69efa3b542f4cc6ece87a0df4bddffd
|
|
| MD5 |
0c532acd3506472b1d26a2a0c226541a
|
|
| BLAKE2b-256 |
67020ce923febb109153d8052e3b25c551c294834f3824418d750f055327c684
|
File details
Details for the file fml_doc_gen-3.0.3-py3-none-any.whl.
File metadata
- Download URL: fml_doc_gen-3.0.3-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85f9128f941933ee86120ad5ef1e64c46438d893494122cef3fdbfe4ba685f7d
|
|
| MD5 |
53abb1e93b00fe10cc6591291ad322bd
|
|
| BLAKE2b-256 |
cfdbf1085d4ef1bd613d137d4e03366cc346434ad8a334aded1cf44108a68513
|