This Python script is designed to interact with the Mealie API, providing additional functionality for managing recipes and more.
It does not include any functions that you can achieve with the standard Mealie API.
Happy cooking with Mealie! 🍲
- Python 3.x
-
Clone the repository:
git clone https://github.com/panteLx/Mealie-Enhanced-API.git
-
Navigate to the project directory:
cd Mealie-Enhanced-API
-
Make the script executable:
chmod +x run.py
-
Install dependencies (if not already installed):
pip install -r requirements.txt
-
Authentication Setup
- The script uses an authentication token and API URL. If not already set, the script prompts the user to enter these details.
- The authentication details are saved in a configuration file (
config/auth.json
) for future use.
-
Choose Script
- The script will check for an established API connection. It will also validate the provided auth token.
- You will be prompted to choose which script you want to run.
-
Bulk Create new recipes from URLs (with/without Tags)
- You will be prompted to input a list of URLs separated by commas.
- For each URL, a POST request is sent to the API to create a corresponding recipe URL.
- If a duplicate is found, you will be prompted to delete it.
- You will be prompted to specify whether to import original keywords as tags for the recipes.
-
ALPHA - Crawl custom website and create new recipes based on crawl results (with/without Tags)
- You can choose the external recipe URL to crawl.
- Crawler will search for all results within your external recipe URL containing a keyword you choose (e.g. "recipes").
- For each crawled URL, a POST request is sent to the API to create a corresponding recipe URL.
- If a duplicate is found, you will be prompted to delete it.
- You will be prompted to specify whether to import original keywords as tags for the recipes.
Script two has a moderate chance to find bad URLs that can't be parsed! Mealie API will throw an error (400). However this won't break anything.
-
Run the script:
./run.py
- Authentication details are stored in the
config/auth.json
file.
- Mealie API Docs check out the API Docs to learn more about the Mealie API
- Mealie Getting Started learn more about Mealie
- The script uses the Requests library (version 2.31.0) for handling HTTP requests.
- Certifi (version 2023.11.17) for providing a curated collection of Root Certificates for validating SSL certificates.
- Charset-normalizer (version 3.3.2) for normalizing Unicode strings and character sets.
- Colorama (version 0.4.6) for adding colored output to the terminal.
- Idna (version 3.6) for handling Internationalized Domain Names in Applications.
- Urllib3 (version 2.1.0) for handling HTTP requests.
This repository is licensed under the GNU General Public License v3.0. Feel free to use, modify, and distribute it. If you encounter any issues or have suggestions, please create an issue in the GitHub repository.