https://github.com/03-bunny-06/recipe-finder-with-rich-display
This Python script allows users to fetch and display recipe details based on a main ingredient using the Spoonacular API. The recipes are presented in a beautifully formatted table using the rich.
https://github.com/03-bunny-06/recipe-finder-with-rich-display
console-application json python-api requests rich-library
Last synced: 2 months ago
JSON representation
This Python script allows users to fetch and display recipe details based on a main ingredient using the Spoonacular API. The recipes are presented in a beautifully formatted table using the rich.
- Host: GitHub
- URL: https://github.com/03-bunny-06/recipe-finder-with-rich-display
- Owner: 03-Bunny-06
- Created: 2025-01-22T04:39:30.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-01-24T14:48:58.000Z (4 months ago)
- Last Synced: 2025-02-10T07:17:59.087Z (4 months ago)
- Topics: console-application, json, python-api, requests, rich-library
- Language: Python
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Recipe Finder with Rich Display
## Project Description
This Python script allows users to fetch and display recipe details based on a main ingredient using the **Spoonacular API**. The recipes are presented in a beautifully formatted table using the **rich** library for enhanced console output.
## Features
- Fetches recipes based on a main ingredient entered by the user.
- Allows users to specify the number of recipes to display.
- Displays detailed recipe information including:
- **Recipe title**
- **Cuisines**
- **Dish types**
- **Preparation time**
- **Serving size**
- **Gluten-free status**
- **Health score**
- Stylish, readable output using `rich.table` with custom styling and formatting.## Prerequisites
- **Python 3.6 or later**
- An active API key from **Spoonacular API**## Installation
1. Clone this repository or copy the script.
2. Install the required libraries:
```bash
pip install requests rich
```## Usage
1. Update the `API_KEY` variable in the script with your **Spoonacular API key**.
2. Run the script:
```bash
python recipe_finder.py
```3. Follow the prompts:
- Enter the main ingredient (e.g., **Chicken, Pasta**).
- Specify the number of recipes to fetch.## Example Output
```plaintext
Enter the main Ingredient of the recipe (Ex: Chicken, Pasta etc.): chickenEnter the number of recipes you would like to view: 15
```
```plaintext
Enter the main Ingredient of the recipe (Ex: Chicken, Pasta etc.): pastaEnter the number of recipes you would like to view: 10
```
## Notes
- Ensure the **API key** is valid; otherwise, the script will not retrieve data.
- The script uses **rich** to enhance the terminal display; ensure your terminal supports rich formatting.