Skip to content

Custom Python Scripts using the Mealie API

License

Notifications You must be signed in to change notification settings

panteLx/Mealie-Enhanced-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mealie Enhanced API

Overview

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! 🍲

Prerequisites

  • Python 3.x

Installation

  1. Clone the repository:

    git clone https://github.com/panteLx/Mealie-Enhanced-API.git
  2. Navigate to the project directory:

    cd Mealie-Enhanced-API
  3. Make the script executable:

    chmod +x run.py
  4. Install dependencies (if not already installed):

    pip install -r requirements.txt

Usage

  1. 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.
  2. 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.

Available Scripts

  1. 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.
  2. 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.

How to Run

  1. Run the script:

    ./run.py

Configuration

  • Authentication details are stored in the config/auth.json file.

Documentation

Acknowledgments

  • 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.

License

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.

About

Custom Python Scripts using the Mealie API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages