Skip to content

Commit

Permalink
Merge pull request #29 from UBC-MDS/ml3-add-more-to-documentation
Browse files Browse the repository at this point in the history
Final Change: Fix Documentation
  • Loading branch information
mikem2m authored Jan 23, 2025
2 parents f7d9234 + 2fee85d commit 9fff59f
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 13 deletions.
38 changes: 29 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
# fml_doc_gen

[![Documentation Status](https://readthedocs.org/projects/fml-doc-gen/badge/?version=latest)](https://fml-doc-gen.readthedocs.io/en/latest/?badge=latest)

## Authors

- Farhan Bin Faisal
- 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

```bash
$ pip install fml_doc_gen
```

## Usage

`generate_docstring_template` can be used to generate docstring template for your function shown below:

```python
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`**:
- **`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 if `auto_generate` is set to `True`.

- **`read_user_function(func: Callable) -> str`**:
Expand All @@ -18,20 +46,12 @@
- **`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`](https://www.sphinx-doc.org/) and [`pydoc`](https://docs.python.org/3/library/pydoc.html) 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!


## Contributors
- 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.
Expand Down
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# -- Project information -----------------------------------------------------

project = u"fml"
copyright = u"2025, Farhan Faisal"
author = u"Farhan Faisal"
copyright = u"2025, Farhan Faisal, Michael Suriawan, Lukman Lateef"
author = u"Farhan Faisal, Michael Suriawan, Lukman Lateef"

# -- General configuration ---------------------------------------------------

Expand All @@ -33,4 +33,4 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
html_theme = "furo"
38 changes: 37 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ sphinx-autoapi = "^3.4.0"
sphinx-rtd-theme = "^3.0.2"
jupyter = "^1.1.1"
myst-nb = "^1.1.2"
furo = "^2024.8.6"

[tool.semantic_release]
version_toml = [
Expand Down

0 comments on commit 9fff59f

Please sign in to comment.