Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/grandmoff100/mealieapi

Control your Mealie instance with python!
https://github.com/grandmoff100/mealieapi

api-client async-await mealie poetry pytest python

Last synced: about 2 months ago
JSON representation

Control your Mealie instance with python!

Awesome Lists containing this project

README

        

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

# ⛔️Paused⛔️

## Not actively being developed, I don't have the bandwidth to develop this anymore.

If anyone wants to become the steward of this project, open an issue and tell me what your plans are!
I'd love for someone to help this project reach its full potential.

# 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

```bash
$ 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.)

```py
import asyncio
from mealieapi import MealieClient

client = MealieClient("")
```
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("", "")` or if you are using an API key you need to use `client.authorize("")` (Note: without the await).

```py
async def main():
await client.login("", "")
# OR
client.authorize("")

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.