Skip to main content

Python library to retrieve information from chefkoch.de

Project description

python_chefkoch

Downloads

Python library to retrieve data from chefkoch.de

Installation

Use the package manager pip to install python_chefkoch

pip install python_chefkoch

Examples:

Retrieving daily recommendations

from python_chefkoch import chefkoch

recipes = chefkoch.get_daily_recommendations(category="backe")

for recipe in recipes:
    print("\n" + str(recipe))

Retrieving a random recipe

from python_chefkoch import chefkoch

recipe = chefkoch.get_random_recipe()
print(recipe.modify_portions(portions=6))

for step in recipe.steps:
    print("Next -> " + step)

Searching for a specific recipe with filter

from python_chefkoch import chefkoch

print(chefkoch.get_specifications())
recipes = chefkoch.search(search_term="Lasagne",
                          filters={"page": 2, "sort": "rating", "duration": 30,
                                            "difficulty": {"easy": True, "medium": True, "hard": False}},
                          specifications=["vegetarisch", "gemuese"])
print(recipes)

Recipe interactions

name type description
get_next_step method returns the next step of the recipe. Throws EndOfRecipeError when the end is reached
modify_portions method modifies the portions and returns the new dict for ingredients
info_dict attribute contains all information retrived directly from javascript from the chefkoch page
ingredients attribute dictionary with ingredients as key and the amount as values. Everything is a string
steps attribute list with all steps. Simply the instruction text split by '.'
image attribute hyper-link to the main image
... attributes more attributes available that are self-explainatory

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Participants

Florian Eder, Moritz Enderle

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

python_chefkoch-2.0.0a1.tar.gz (8.1 kB view hashes)

Uploaded Source

Built Distribution

python_chefkoch-2.0.0a1-py3-none-any.whl (8.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page