refactor(memobird): switch to uv with inline script dependencies

This commit is contained in:
Moritz Graf
2026-05-19 22:00:13 +02:00
parent 64137350b4
commit 2a6709d5bc
3 changed files with 15 additions and 29 deletions
+8 -16
View File
@@ -1,4 +1,10 @@
#!/usr/bin/env python3
# /// script
# dependencies = [
# "requests",
# "pillow",
# ]
# ///
import sys
import os
import json
@@ -6,22 +12,8 @@ import base64
from io import BytesIO
from random import randint
import argparse
# Dependency Check
MISSING_DEPS = []
try:
import requests
except ImportError:
MISSING_DEPS.append("requests")
try:
from PIL import Image as PILImg, ImageOps
except ImportError:
MISSING_DEPS.append("Pillow (PIL)")
if MISSING_DEPS:
print(f"Error: Missing dependencies: {', '.join(MISSING_DEPS)}")
print("Please install them using: pip install " + " ".join(["requests", "Pillow"]))
sys.exit(1)
import requests
from PIL import Image as PILImg, ImageOps
# Default IP for Moritz's Memobird
DEFAULT_HOST = "192.168.10.165"