summaryrefslogtreecommitdiff
path: root/providers/manual.py
diff options
context:
space:
mode:
authoryyamashita <8nmdh5w22f@privaterelay.appleid.com>2026-11-01 08:59:15 +0900
committeryyamashita <8nmdh5w22f@privaterelay.appleid.com>2026-11-01 08:59:15 +0900
commita661eedbd30206e940ed8fb6a19f139311adbdfb (patch)
tree6eed45d0a1d7b9be04de04c6d93f491a5071109c /providers/manual.py
西荻窪周辺スタジオの空き枠一覧ページを追加
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'providers/manual.py')
-rw-r--r--providers/manual.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/providers/manual.py b/providers/manual.py
new file mode 100644
index 0000000..4623b26
--- /dev/null
+++ b/providers/manual.py
@@ -0,0 +1,28 @@
+"""manual_slots.json に手で書いた予約済み枠を読む。書いていない枠は空きとみなす。
+
+形式:
+{
+ "uen": {
+ "2026-11-03": {"1st": [18, 19, 20], "2nd": [21]}
+ }
+}
+"""
+
+import json
+from pathlib import Path
+
+PATH = Path(__file__).resolve().parent.parent / "manual_slots.json"
+
+
+def fetch(studio, date):
+ data = json.loads(PATH.read_text(encoding="utf-8")) if PATH.exists() else {}
+ booked = data.get(studio["id"], {}).get(date.isoformat(), {})
+ return [
+ {
+ "room": room,
+ "hour": hour,
+ "status": "booked" if hour in booked.get(room, []) else "free",
+ }
+ for room in studio["rooms"]
+ for hour in range(studio["open"], studio["close"])
+ ]