Skip to main content

Control your Mealie instance with python!

Project description

mealie-image

Mealie API

If you are running a self-hosted Mealie server you can use this library to authenticate yourself with and intereact with it! Create mealplans, import recipes, remove users, modify user groups, upload recipe images. All with MealieAPI.

Installation

$ pip install mealieapi

Usage

Authentication

To start you need your Mealie server url, and your login credentials or an API key (which you can create at https://[YOUR_MEALIE_SERVER]/admin/profile). MealieAPI uses the async/await syntax so you must run it inside an async function or event loop like so (if you are not familiar with async applications already.)

import asyncio
from mealieapi import MealieClient


client = MealieClient("<YOUR_MEALIE_SERVER_ADDRESS>")

This next part depends on whether you have an API key, or your login credentials.

If you want to use your username and password you must use await client.login("<USERNAME_OR_EMAIL>", "<PASSWORD>") or if you are using an API key you need to use client.authorize("<API_KEY>") (Note: without the await).

async def main():
    await client.login("<USERNAME_OR_EMAIL>", "<PASSWORD>")
    # OR
    client.authorize("<API_KEY>")

loop = asyncio.get_event_loop()
loop.run_until_complete(main())

Docs

A work in progress.

Contributions

All contributions are welcome! Thats what makes Open-Source so special.

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

mealieapi-0.0.1.tar.gz (23.5 kB view hashes)

Uploaded Source

Built Distribution

mealieapi-0.0.1-py3-none-any.whl (26.2 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