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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mealieapi-0.0.1-py3-none-any.whl (26.2 kB view details)

Uploaded Python 3

File details

Details for the file mealieapi-0.0.1.tar.gz.

File metadata

  • Download URL: mealieapi-0.0.1.tar.gz
  • Upload date:
  • Size: 23.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.11.1 Linux/5.15.0-1024-azure

File hashes

Hashes for mealieapi-0.0.1.tar.gz
Algorithm Hash digest
SHA256 92b8ebc216fd018e4e795bee0da93ef6bd82ec9a9ee71d359b69fa378a727d09
MD5 b561a591b6f8f71fb361dac4d997a3a8
BLAKE2b-256 b59f617384a5d5a437d3074535b4f0d7255748e89bd72bdbe11a8d6bfa013e6a

See more details on using hashes here.

File details

Details for the file mealieapi-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: mealieapi-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 26.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.11.1 Linux/5.15.0-1024-azure

File hashes

Hashes for mealieapi-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 36d12d1917662cd3ba1c09189a3965ee24ca520fae037510c624137389a8eb5b
MD5 2ba5b113af7415b48e44977e844ea871
BLAKE2b-256 3ebb792bb610b4656805fa6ae84ef0077493d522330c61e2a87e394749a55c03

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page