Control your Mealie instance with python!
Project description
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
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())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for MealieAPI-0.0.1rc0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7223319f2848474feb3baaa1e1d189a9c53851cc1283fc3c8c26ab64b12a9820 |
|
MD5 | eaed75054fc21966f64a4fdc8801ac06 |
|
BLAKE2b-256 | c4ad55cda409490160d08ab61df2d731a4f192867455678fb5c44a7d78d46dce |