Metadata-Version: 2.1
Name: mealieapi
Version: 0.0.0b0
Summary: Control your Mealie instance with python!
Home-page: https://github.com/GrandMoff100/MealieAPI
License: GPLv3
Author: GrandMoff100
Author-email: nlarsen23.student@gmail.com
Maintainer: GrandMoff100
Maintainer-email: nlarsen23.student@gmail.com
Requires-Python: >=3.7,<4.0
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: aiohttp (>=3.8.1,<4.0.0)
Project-URL: Documentation, https://github.com/GrandMoff100/MealieAPI/tree/master/README.md
Project-URL: Repository, https://github.com/GrandMoff100/MealieAPI
Description-Content-Type: text/markdown

![mealie-image](https://hay-kot.github.io/mealie/assets/img/home_screenshot.png)

# Mealie API
If you are running a self-hosted [Mealie](https://hay-kot.github.io/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.)


```py
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())
```



