.. Lumache documentation master file, created by sphinx-quickstart on Mon May 22 23:33:09 2023. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive.
Welcome to Lumache's documentation! =================================== .. toctree:: :maxdepth: 2 :caption: Contents: **Lumache** (/lu'make/) is a Python library for cooks and food lovers that creates recipes mixing random ingredients. It pulls data from the `Open Food Facts database <https://world.openfoodfacts.org/>`_ and offers a *simple* and *intuitive* API.
# Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'sphinx.ext.duration', ]
Welcome to Lumache's documentation! ===================================
.. toctree:: :maxdepth: 2 :caption: Contents:
usage **Lumache** (/lu'make/) is a Python library for cooks and food lovers that creates recipes mixing random ingredients. It pulls data from the `Open Food Facts database <https://world.openfoodfacts.org/>`_ and offers a *simple* and *intuitive* API.
.. Lumache documentation master file, created by sphinx-quickstart on Mon May 22 23:33:09 2023. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive.
Welcome to Lumache's documentation! ===================================
.. toctree:: :maxdepth: 2 :caption: Contents:
usage
Check out the :doc:`usage` section for further information.
.. Lumache documentation master file, created by sphinx-quickstart on Mon May 22 23:33:09 2023. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive.
Welcome to Lumache's documentation! ===================================
.. toctree:: :maxdepth: 2 :caption: Contents:
usage
Check out the :doc:`usage` section for further information, including how to :ref:`install <installation>` the project.
:param kind: Optional "kind" of ingredients. :type kind: list[str] or None :return: The ingredients list. :rtype: list[str]
The ``kind`` parameter should be either ``"meat"``, ``"fish"``, or ``"veggies"``. Otherwise, :py:func:`lumache.get_random_ingredients` will raise an exception.
:param kind: Optional "kind" of ingredients. :type kind: list[str] or None :raise lumache.InvalidKindError: If the kind is invalid. :return: The ingredients list. :rtype: list[str]
:param kind: Optional "kind" of ingredients. :type kind: list[str] or None :raise lumache.InvalidKindError: If the kind is invalid. :return: The ingredients list. :rtype: list[str]
.. py:exception:: lumache.InvalidKindError
Raised if the kind is invalid.
The ``kind`` parameter should be either ``"meat"``, ``"fish"``, or ``"veggies"``. Otherwise, :py:func:`lumache.get_random_ingredients` will raise an exception.
# If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. import pathlib import sys sys.path.insert(0, pathlib.Path(__file__).parents[2].resolve().as_posix())
$ cat source/conf.py # Configuration file for the Sphinx documentation builder. # # For the full list of built-in configuration values, see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html
# If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. import pathlib import sys sys.path.insert(0, pathlib.Path(__file__).parents[2].resolve().as_posix())
# -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
# -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
:param kind: Optional "kind" of ingredients. :type kind: list[str] or None :raise lumache.InvalidKindError: If the kind is invalid. :return: The ingredients list. :rtype: list[str]
.. py:exception:: lumache.InvalidKindError
Raised if the kind is invalid.
The ``kind`` parameter should be either ``"meat"``, ``"fish"``, or ``"veggies"``. Otherwise, :py:func:`lumache.get_random_ingredients` will raise an exception.
classInvalidKindError(Exception): """Raised if the kind is invalid.""" pass
defget_random_ingredients(kind=None): """ Return a list of random ingredients as strings. :param kind: Optional "kind" of ingredients. :type kind: list[str] or None :raise lumache.InvalidKindError: If the kind is invalid. :return: The ingredients list. :rtype: list[str] """ return ["shells", "gorgonzola", "parsley"]
To retrieve a list of random ingredients, you can use the ``lumache.get_random_ingredients()`` function:
.. autofunction:: lumache.get_random_ingredients
.. autoexception:: lumache.InvalidKindError
The ``kind`` parameter should be either ``"meat"``, ``"fish"``, or ``"veggies"``. Otherwise, :py:func:`lumache.get_random_ingredients` will raise an exception.