Andréas Livet
2 years ago
13 changed files with 73 additions and 102 deletions
@ -0,0 +1,8 @@ |
|||||||
|
Documentation du Vhéliotech |
||||||
|
======================================= |
||||||
|
|
||||||
|
Ce dépôt est un test de documentation collaborative pour le Vhéliotech. |
||||||
|
|
||||||
|
::::{important} |
||||||
|
Ceci n'est pas la documentation officielle du Vhélio, vous la trouverez à cette adresse : https://communaute.vhelio.org/d/4-documentation-du-vheliotech-indice-001-mars-2022 |
||||||
|
:::: |
@ -1,9 +0,0 @@ |
|||||||
Template for the Read the Docs tutorial |
|
||||||
======================================= |
|
||||||
|
|
||||||
This GitHub template includes fictional Python library |
|
||||||
with some basic Sphinx docs. |
|
||||||
|
|
||||||
Read the tutorial here: |
|
||||||
|
|
||||||
https://docs.readthedocs.io/en/stable/tutorial/ |
|
@ -1,7 +0,0 @@ |
|||||||
API |
|
||||||
=== |
|
||||||
|
|
||||||
.. autosummary:: |
|
||||||
:toctree: generated |
|
||||||
|
|
||||||
lumache |
|
After Width: | Height: | Size: 208 KiB |
After Width: | Height: | Size: 258 KiB |
After Width: | Height: | Size: 14 KiB |
@ -1,22 +0,0 @@ |
|||||||
Welcome to Lumache's documentation! |
|
||||||
=================================== |
|
||||||
|
|
||||||
**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. |
|
||||||
|
|
||||||
Check out the :doc:`usage` section for further information, including |
|
||||||
how to :ref:`installation` the project. |
|
||||||
|
|
||||||
.. note:: |
|
||||||
|
|
||||||
This project is under active development. |
|
||||||
|
|
||||||
Contents |
|
||||||
-------- |
|
||||||
|
|
||||||
.. toctree:: |
|
||||||
|
|
||||||
usage |
|
||||||
api |
|
@ -1,34 +0,0 @@ |
|||||||
Usage |
|
||||||
===== |
|
||||||
|
|
||||||
.. _installation: |
|
||||||
|
|
||||||
Installation |
|
||||||
------------ |
|
||||||
|
|
||||||
To use Lumache, first install it using pip: |
|
||||||
|
|
||||||
.. code-block:: console |
|
||||||
|
|
||||||
(.venv) $ pip install lumache |
|
||||||
|
|
||||||
Creating recipes |
|
||||||
---------------- |
|
||||||
|
|
||||||
To retrieve a list of random ingredients, |
|
||||||
you can use the ``lumache.get_random_ingredients()`` function: |
|
||||||
|
|
||||||
.. autofunction:: lumache.get_random_ingredients |
|
||||||
|
|
||||||
The ``kind`` parameter should be either ``"meat"``, ``"fish"``, |
|
||||||
or ``"veggies"``. Otherwise, :py:func:`lumache.get_random_ingredients` |
|
||||||
will raise an exception. |
|
||||||
|
|
||||||
.. autoexception:: lumache.InvalidKindError |
|
||||||
|
|
||||||
For example: |
|
||||||
|
|
||||||
>>> import lumache |
|
||||||
>>> lumache.get_random_ingredients() |
|
||||||
['shells', 'gorgonzola', 'parsley'] |
|
||||||
|
|
@ -1,23 +0,0 @@ |
|||||||
""" |
|
||||||
Lumache - Python library for cooks and food lovers. |
|
||||||
""" |
|
||||||
|
|
||||||
__version__ = "0.1.0" |
|
||||||
|
|
||||||
|
|
||||||
class InvalidKindError(Exception): |
|
||||||
"""Raised if the kind is invalid.""" |
|
||||||
pass |
|
||||||
|
|
||||||
|
|
||||||
def get_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"] |
|
Loading…
Reference in new issue