Compare commits

...

4 Commits

Author SHA1 Message Date
aa5bc3d3c8 Add autofilter to all Excel report sheets
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 18:29:37 +01:00
d783882cf6 Centralize token.txt to project root
- Updated 35 scripts to read token.txt from project root
  using Path(__file__).resolve().parent.parent / "token.txt"
- Removed 6 duplicate token.txt files from subdirectories
- Single token.txt in project root serves all scripts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 18:27:38 +01:00
5992a01cdd Merge branch 'master' of https://gitea.buzalka.cz/administrator/medevio 2026-03-10 18:16:53 +01:00
040e6074ae Add token.txt for agenda report scripts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 18:16:40 +01:00
42 changed files with 38 additions and 48 deletions

Submodule .claude/worktrees/heuristic-lichterman deleted from e345e477d3

View File

@@ -8,10 +8,11 @@ Reads Bearer token from token.txt (single line, token only).
import requests import requests
import pandas as pd import pandas as pd
import time import time
from pathlib import Path
from typing import List, Dict, Any from typing import List, Dict, Any
# CONFIG --------------------------------------------------------------------- # CONFIG ---------------------------------------------------------------------
TOKEN_FILE = "token.txt" # file with token (no "Bearer " prefix) TOKEN_FILE = str(Path(__file__).resolve().parent.parent / "token.txt") # centralized token
GRAPHQL_URL = "https://app.medevio.cz/graphql" GRAPHQL_URL = "https://app.medevio.cz/graphql"
CLINIC_SLUG = "mudr-buzalkova" # adjust if needed CLINIC_SLUG = "mudr-buzalkova" # adjust if needed
LOCALE = "cs" LOCALE = "cs"

View File

@@ -6,7 +6,7 @@ from pathlib import Path
import requests # 👈 this is new import requests # 👈 this is new
# --- Settings ---------------------------------------------------- # --- Settings ----------------------------------------------------
TOKEN_PATH = Path("token.txt") # file contains ONLY the token, no "Bearer " TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
CLINIC_SLUG = "mudr-buzalkova" CLINIC_SLUG = "mudr-buzalkova"
SHOW_FULL_TOKEN = False # set True if you want to print the full token SHOW_FULL_TOKEN = False # set True if you want to print the full token
# ----------------------------------------------------------------- # -----------------------------------------------------------------

View File

@@ -6,7 +6,7 @@ from pathlib import Path
import requests import requests
# --- Settings ---------------------------------------------------- # --- Settings ----------------------------------------------------
TOKEN_PATH = Path("token.txt") # file contains ONLY the token, no "Bearer " TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
CLINIC_SLUG = "mudr-buzalkova" CLINIC_SLUG = "mudr-buzalkova"
# ----------------------------------------------------------------- # -----------------------------------------------------------------

View File

@@ -5,7 +5,7 @@ import json
from pathlib import Path from pathlib import Path
import requests import requests
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
CLINIC_SLUG = "mudr-buzalkova" CLINIC_SLUG = "mudr-buzalkova"
# --- Try including `updatedAt` field directly --- # --- Try including `updatedAt` field directly ---

View File

@@ -5,7 +5,7 @@ import json
from pathlib import Path from pathlib import Path
import requests import requests
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
CLINIC_SLUG = "mudr-buzalkova" CLINIC_SLUG = "mudr-buzalkova"
GRAPHQL_QUERY = r""" GRAPHQL_QUERY = r"""

View File

@@ -11,7 +11,7 @@ from datetime import datetime
# ================================ # ================================
# 🔧 CONFIGURATION # 🔧 CONFIGURATION
# ================================ # ================================
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
CLINIC_SLUG = "mudr-buzalkova" CLINIC_SLUG = "mudr-buzalkova"
BATCH_SIZE = 100 BATCH_SIZE = 100
STATES = ["ACTIVE", "DONE"] # optionally add "REMOVED" STATES = ["ACTIVE", "DONE"] # optionally add "REMOVED"

View File

@@ -11,7 +11,7 @@ from datetime import datetime
# ================================ # ================================
# 🔧 CONFIGURATION # 🔧 CONFIGURATION
# ================================ # ================================
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
CLINIC_SLUG = "mudr-buzalkova" CLINIC_SLUG = "mudr-buzalkova"
BATCH_SIZE = 1000 BATCH_SIZE = 1000
STATES = ["ACTIVE", "DONE"] # optionally add "REMOVED" STATES = ["ACTIVE", "DONE"] # optionally add "REMOVED"

View File

@@ -3,7 +3,7 @@ import json
from pathlib import Path from pathlib import Path
# === Nastavení === # === Nastavení ===
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
REQUEST_ID = "092a0c63-28be-4c6b-ab3b-204e1e2641d4" REQUEST_ID = "092a0c63-28be-4c6b-ab3b-204e1e2641d4"
OUTPUT_DIR = Path(r"u:\Dropbox\!!!Days\Downloads Z230\Medevio_přílohy") OUTPUT_DIR = Path(r"u:\Dropbox\!!!Days\Downloads Z230\Medevio_přílohy")

View File

@@ -2,7 +2,7 @@ import requests
import json import json
from pathlib import Path from pathlib import Path
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
REQUEST_ID = "092a0c63-28be-4c6b-ab3b-204e1e2641d4" REQUEST_ID = "092a0c63-28be-4c6b-ab3b-204e1e2641d4"
CLINIC_SLUG = "mudr-buzalkova" CLINIC_SLUG = "mudr-buzalkova"

View File

@@ -13,7 +13,7 @@ import shutil
# ============================== # ==============================
# 🔧 CONFIGURATION # 🔧 CONFIGURATION
# ============================== # ==============================
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
CLINIC_SLUG = "mudr-buzalkova" CLINIC_SLUG = "mudr-buzalkova"
BASE_DIR = Path(r"u:\Dropbox\ordinace\Dokumentace_ke_zpracování\Medevio_přílohy") BASE_DIR = Path(r"u:\Dropbox\ordinace\Dokumentace_ke_zpracování\Medevio_přílohy")
BASE_DIR.mkdir(parents=True, exist_ok=True) BASE_DIR.mkdir(parents=True, exist_ok=True)

View File

@@ -20,7 +20,7 @@ import time
# ============================== # ==============================
# 🔧 CONFIGURATION # 🔧 CONFIGURATION
# ============================== # ==============================
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
CLINIC_SLUG = "mudr-buzalkova" CLINIC_SLUG = "mudr-buzalkova"
DB_CONFIG = { DB_CONFIG = {

View File

@@ -17,7 +17,7 @@ import time
# ============================== # ==============================
# 🔧 CONFIGURATION # 🔧 CONFIGURATION
# ============================== # ==============================
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
GRAPHQL_URL = "https://api.medevio.cz/graphql" GRAPHQL_URL = "https://api.medevio.cz/graphql"
DB_CONFIG = { DB_CONFIG = {

View File

@@ -16,7 +16,7 @@ import time
# ============================== # ==============================
# 🔧 CONFIGURATION # 🔧 CONFIGURATION
# ============================== # ==============================
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
CLINIC_SLUG = "mudr-buzalkova" CLINIC_SLUG = "mudr-buzalkova"
GRAPHQL_URL = "https://api.medevio.cz/graphql" GRAPHQL_URL = "https://api.medevio.cz/graphql"

View File

@@ -10,7 +10,7 @@ import time, socket
# =============================== # ===============================
# ⚙️ CONFIG # ⚙️ CONFIG
# =============================== # ===============================
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
CLINIC_SLUG = "mudr-buzalkova" CLINIC_SLUG = "mudr-buzalkova"
DB_CONFIG = { DB_CONFIG = {

View File

@@ -10,7 +10,7 @@ import time
# ================================ # ================================
# ⚙️ CONFIGURATION # ⚙️ CONFIGURATION
# ================================ # ================================
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
CLINIC_SLUG = "mudr-buzalkova" CLINIC_SLUG = "mudr-buzalkova"
BATCH_SIZE = 100 BATCH_SIZE = 100

View File

@@ -18,7 +18,7 @@ import time
# ============================== # ==============================
# 🔧 CONFIGURATION # 🔧 CONFIGURATION
# ============================== # ==============================
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
CLINIC_SLUG = "mudr-buzalkova" CLINIC_SLUG = "mudr-buzalkova"
DB_CONFIG = { DB_CONFIG = {

View File

@@ -23,7 +23,7 @@ except AttributeError:
# ================================ # ================================
# 🔧 CONFIGURATION # 🔧 CONFIGURATION
# ================================ # ================================
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
CLINIC_SLUG = "mudr-buzalkova" CLINIC_SLUG = "mudr-buzalkova"
BATCH_SIZE = 100 BATCH_SIZE = 100

View File

@@ -10,7 +10,7 @@ from dateutil import parser
# ================================ # ================================
# 🔧 CONFIGURATION # 🔧 CONFIGURATION
# ================================ # ================================
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
CLINIC_SLUG = "mudr-buzalkova" CLINIC_SLUG = "mudr-buzalkova"
LIMIT = 500 # batch size / number of records LIMIT = 500 # batch size / number of records

View File

@@ -45,7 +45,7 @@ def safe_print(text: str):
# ============================== # ==============================
# 🔧 CONFIGURATION # 🔧 CONFIGURATION
# ============================== # ==============================
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
CLINIC_SLUG = "mudr-buzalkova" CLINIC_SLUG = "mudr-buzalkova"
GRAPHQL_URL = "https://api.medevio.cz/graphql" GRAPHQL_URL = "https://api.medevio.cz/graphql"

View File

@@ -47,7 +47,7 @@ def safe_print(text: str):
# ============================== # ==============================
# 🔧 CONFIGURATION # 🔧 CONFIGURATION
# ============================== # ==============================
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
DB_CONFIG = { DB_CONFIG = {
"host": "192.168.1.76", "host": "192.168.1.76",

View File

@@ -40,7 +40,7 @@ def safe_print(text: str):
# ============================== # ==============================
# CONFIG # CONFIG
# ============================== # ==============================
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
DB_CONFIG = { DB_CONFIG = {
"host": "192.168.1.76", "host": "192.168.1.76",

View File

@@ -48,7 +48,7 @@ def safe_print(text: str):
# ============================== # ==============================
# 🔧 CONFIGURATION # 🔧 CONFIGURATION
# ============================== # ==============================
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
CLINIC_SLUG = "mudr-buzalkova" CLINIC_SLUG = "mudr-buzalkova"
DB_CONFIG = { DB_CONFIG = {

View File

@@ -1 +0,0 @@
nYvrvgflIKcDiQg8Hhpud+qG8iGZ8eH8su4nyT/Mgcm7XQp65ygY9s39+O01wIpk/7sKd6fBHkiKvsqH

View File

@@ -20,7 +20,7 @@ import time
# ============================== # ==============================
# 🔧 CONFIGURATION # 🔧 CONFIGURATION
# ============================== # ==============================
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
CLINIC_SLUG = "mudr-buzalkova" CLINIC_SLUG = "mudr-buzalkova"
DB_CONFIG = { DB_CONFIG = {

View File

@@ -35,7 +35,7 @@ def safe_print(text: str):
# ================================ # ================================
# 🔧 CONFIG # 🔧 CONFIG
# ================================ # ================================
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
CLINIC_SLUG = "mudr-buzalkova" CLINIC_SLUG = "mudr-buzalkova"
BATCH_SIZE = 500 BATCH_SIZE = 500

View File

@@ -21,7 +21,7 @@ import argparse
# ============================== # ==============================
# 🔧 CONFIGURATION # 🔧 CONFIGURATION
# ============================== # ==============================
TOKEN_PATH = Path("../10ReadPozadavky/token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
DB_CONFIG = { DB_CONFIG = {
"host": "192.168.1.76", "host": "192.168.1.76",

View File

@@ -1 +0,0 @@
nYvrvgflIKcDiQg8Hhpud+qG8iGZ8eH8su4nyT/Mgcm7XQp65ygY9s39+O01wIpk/7sKd6fBHkiKvsqH

View File

@@ -21,7 +21,7 @@ except AttributeError:
# ================================ # ================================
# 🔧 CONFIGURATION # 🔧 CONFIGURATION
# ================================ # ================================
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
CLINIC_SLUG = "mudr-buzalkova" CLINIC_SLUG = "mudr-buzalkova"
BATCH_SIZE = 100 BATCH_SIZE = 100

View File

@@ -35,7 +35,7 @@ def safe_print(text: str):
# ================================ # ================================
# 🔧 CONFIG # 🔧 CONFIG
# ================================ # ================================
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
CLINIC_SLUG = "mudr-buzalkova" CLINIC_SLUG = "mudr-buzalkova"
BATCH_SIZE = 500 BATCH_SIZE = 500

View File

@@ -41,7 +41,7 @@ def safe_print(text: str):
# ============================== # ==============================
# 🔧 CONFIGURATION (UPDATED TO 192.168.1.50) # 🔧 CONFIGURATION (UPDATED TO 192.168.1.50)
# ============================== # ==============================
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
CLINIC_SLUG = "mudr-buzalkova" CLINIC_SLUG = "mudr-buzalkova"
GRAPHQL_URL = "https://api.medevio.cz/graphql" GRAPHQL_URL = "https://api.medevio.cz/graphql"

View File

@@ -19,7 +19,7 @@ except AttributeError:
# ============================== # ==============================
# CONFIG (.50) # CONFIG (.50)
# ============================== # ==============================
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
DB_CONFIG = { DB_CONFIG = {
"host": "192.168.1.50", "host": "192.168.1.50",

View File

@@ -40,7 +40,7 @@ def safe_print(text: str):
# ============================== # ==============================
# 🔧 CONFIGURATION (.50) # 🔧 CONFIGURATION (.50)
# ============================== # ==============================
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
CLINIC_SLUG = "mudr-buzalkova" CLINIC_SLUG = "mudr-buzalkova"
DB_CONFIG = { DB_CONFIG = {

View File

@@ -1 +0,0 @@
nYvrvgflIKcDiQg8Hhpud+qG8iGZ8eH8su4nyT/Mgcm7XQp65ygY9s39+O01wIpk/7sKd6fBHkiKvsqH

View File

@@ -13,7 +13,7 @@ except:
# === CONFIG === # === CONFIG ===
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
GRAPHQL_URL = "https://api.medevio.cz/graphql" GRAPHQL_URL = "https://api.medevio.cz/graphql"
REQUEST_ID = "e17536c4-ed22-4242-ada5-d03713e0b7ac" # požadavek který sledujeme REQUEST_ID = "e17536c4-ed22-4242-ada5-d03713e0b7ac" # požadavek který sledujeme

View File

@@ -13,7 +13,7 @@ except:
# === CONFIG === # === CONFIG ===
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
GRAPHQL_URL = "https://api.medevio.cz/graphql" GRAPHQL_URL = "https://api.medevio.cz/graphql"
REQUEST_ID = "e17536c4-ed22-4242-ada5-d03713e0b7ac" # požadavek REQUEST_ID = "e17536c4-ed22-4242-ada5-d03713e0b7ac" # požadavek

View File

@@ -16,7 +16,7 @@ except:
# === KONFIGURACE === # === KONFIGURACE ===
# --- Medevio API --- # --- Medevio API ---
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
GRAPHQL_URL = "https://api.medevio.cz/graphql" GRAPHQL_URL = "https://api.medevio.cz/graphql"
# --- ZPRACOVÁNÍ --- # --- ZPRACOVÁNÍ ---

View File

@@ -1 +0,0 @@
nYvrvgflIKcDiQg8Hhpud+qG8iGZ8eH8su4nyT/Mgcm7XQp65ygY9s39+O01wIpk/7sKd6fBHkiKvsqH

View File

@@ -50,11 +50,7 @@ timestamp = datetime.now().strftime("%Y-%m-%d %H-%M-%S")
xlsx_path = EXPORT_DIR / f"{timestamp} Agenda + Požadavky.xlsx" xlsx_path = EXPORT_DIR / f"{timestamp} Agenda + Požadavky.xlsx"
# ==================== LOAD TOKEN ==================== # ==================== LOAD TOKEN ====================
TOKEN_PATH = Path("token.txt") TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
if not TOKEN_PATH.exists():
TOKEN_PATH = Path(__file__).parent / "token.txt"
if not TOKEN_PATH.exists():
raise SystemExit(f"❌ token.txt not found")
gateway_token = TOKEN_PATH.read_text(encoding="utf-8").strip() gateway_token = TOKEN_PATH.read_text(encoding="utf-8").strip()
headers = { headers = {
@@ -107,6 +103,7 @@ def format_ws(ws, df):
cell.hyperlink = REQUEST_URL_TEMPLATE.format(cell.value) cell.hyperlink = REQUEST_URL_TEMPLATE.format(cell.value)
cell.font = link_font cell.font = link_font
ws.freeze_panes = "A2" ws.freeze_panes = "A2"
ws.auto_filter.ref = ws.dimensions
# ==================== 1⃣ LOAD AGENDA (API) ==================== # ==================== 1⃣ LOAD AGENDA (API) ====================

View File

@@ -6,7 +6,7 @@ import json
import requests import requests
from pathlib import Path from pathlib import Path
TOKEN_PATH = Path(__file__).parent / "token.txt" TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
GRAPHQL_URL = "https://api.medevio.cz/graphql" GRAPHQL_URL = "https://api.medevio.cz/graphql"
CLINIC_SLUG = "mudr-buzalkova" CLINIC_SLUG = "mudr-buzalkova"
REQUEST_ID = "6b46b5a8-b080-4821-86b0-39adabeec86b" REQUEST_ID = "6b46b5a8-b080-4821-86b0-39adabeec86b"

View File

@@ -37,9 +37,7 @@ DRY_RUN = False
GRAPHQL_URL = "https://api.medevio.cz/graphql" GRAPHQL_URL = "https://api.medevio.cz/graphql"
CLINIC_SLUG = "mudr-buzalkova" CLINIC_SLUG = "mudr-buzalkova"
TOKEN_PATH = Path(__file__).parent / "token.txt" TOKEN_PATH = Path(__file__).resolve().parent.parent / "token.txt"
if not TOKEN_PATH.exists():
raise SystemExit("❌ token.txt not found")
gateway_token = TOKEN_PATH.read_text(encoding="utf-8").strip() gateway_token = TOKEN_PATH.read_text(encoding="utf-8").strip()
headers = { headers = {

View File

@@ -1 +0,0 @@
nYvrvgflIKcDiQg8Hhpud+qG8iGZ8eH8su4nyT/Mgcm7XQp65ygY9s39+O01wIpk/7sKd6fBHkiKvsqH