randomly chooses ingredients from a menu for a nice cocktail recipe

Input

  • alcohol [list]
  • decor [list]

Output

  • cocktail_generator [str]

Endpoint

https://hub.xpub.nl/soupboat/si16/api/cocktail_generator/ ? alcohol=<alcohol> & decor=<decor>

Try it



cocktail_generator

randomly chooses ingredients from a menu for a nice cocktail recipe

def cocktail_generator(alcohol: list, decor: list) -> str:
    """randomly chooses ingredients from a menu for a nice cocktail recipe"""

    import datetime
    from datetime import timedelta
    now = datetime.datetime.now() + timedelta(hours=1)        
    from random import choice

    base = ["ORANGE JUICE", "PINEAPPLE JUICE", "APPLE JUICE", "MANGO JUICE", "FRIZZY WATER", "GRAPEFRUIT JUICE", "TONIC WATER"]

    sour = ["LEMON JUICE", "LIME JUICE", "PASSION FRUIT"]

    sweet = ["AGAVE SIRUP", "SUGAR SIRUP", "MAPLE SIRUP"]

    omph = ["1 SLICE       GINGER", "2 LEAVES      MINT", "1 SLICE       CUCUMBER", "1 STICK       CINNAMON", "              SALT RIM"]        


    snack = ["CHIPS", "SALTED CORN", "PRETZELS", "SALTED NUTS"]


    XPUB1 = [" (*(*(*(*(*.(*.*).*)*)*)*)*)*)", " (^(^(^(^(^.(^.^).^)^)^)^)^)^)"]


    drink = ["""
           ___, 
          '._.'\ 
       _____/'-.\ 
      |    / | 
      |~~~/~~| 
      \ ()   / 
       '.__.' 
         || 
        _||_ 
       `----` """, """
              .
          .  . 
       |^ .
      \O___.____ /
        \   .  /
          \ ,/
           []
           []
           []
        --------            
           """, """
        \ 
       .-\""""""""-.
        \ \__ o . /
         \/  \  o/
          \__/. /
           \_ _/
             Y
             |
         _.-' '-._
        `---------` """]




    recipe = f"""
<pre>

*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
*                             *
*   CATWALKING WITH ALCOHOL   *
*                             *
*    {now.strftime("%Y-%m-%d   %H:%M:%S")}    *
*                             *
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*



2 oz          {choice(alcohol)}

150 ml        {choice(base)}

1 oz          {choice(sour)}

0.5 oz        {choice(sweet)}

{choice(omph)}

1             {choice(decor)}


*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*

EXTRA: {choice(snack)}

*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*


           ___, 
          '._.'\ 
       _____/'-.\ 
      |    / | 
      |~~~/~~| 
      \ ()   / 
       '.__.' 
         || 
        _||_ 
       `----` 


THANKS FOR COMING TO OUR LAUNCH!

{choice(XPUB1)}


*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*

</pre>
    """



    return recipe

cocktail_generator

This function generates amazing cocktail recipes for you to try! The cocktail menu includes the categories alcohol, base, sour, sweet and omph. There is also a category for a decorative gadget and one for an extra snack. Each category has a default list of ingredients and the function randomly chooses one ingredient per category. You prefer Rum and Tequila over Vodka? Or maybe you want a non-alcoholic cocktail? Don´t worry! For the categories alcohol and decor you can insert your own ingredients to pick from. Enjoy!

Menu:

default ingredients:
base = ORANGE JUICE, PINEAPPLE JUICE, APPLE JUICE, MANGO JUICE, FRIZZY WATER, GRAPEFRUIT JUICE, TONIC WATER
sour = LEMON JUICE, LIME JUICE, PASSION FRUIT
sweet = AGAVE SIRUP, SUGAR SIRUP, MAPLE SIRUP
omph = 1 SLICE GINGER, 2 LEAVES MINT, 1 SLICE CUCUMBER, 1 STICK CINNAMON, SALT RIM    
snack = CHIPS, SALTED CORN, PRETZELS, SALTED NUTS

users ingredients:
alcohol =
decor =

Examples

In this exmaple the function chooses between three alcoholic ingredients and two decoratin gadgets

print(cocktail_generator(['VODKA', 'TEQUILA', 'RUM'], ['UMBRELLA', 'PALMTREE', 'FLAMINGO']))
<pre>

*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
*                             *
*   CATWALKING WITH ALCOHOL   *
*                             *
*    2021-12-14   14:08:04    *
*                             *
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*



2 oz          VODKA

150 ml        GRAPEFRUIT JUICE

1 oz          LEMON JUICE

0.5 oz        SUGAR SIRUP

1 SLICE       CUCUMBER

1             UMBRELLA


*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*

EXTRA: SALTED CORN

*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*


           ___, 
          '._.'\ 
       _____/'-.\ 
      |    / | 
      |~~~/~~| 
      \ ()   / 
       '.__.' 
         || 
        _||_ 
       `----`


THANKS FOR COMING TO OUR LAUNCH!

 (^(^(^(^(^.(^.^).^)^)^)^)^)^)


*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*

</pre>