Dalsi banky, prehled ve Swaggeru, /status a prazdne promenne

- zdroje rb, unicredit a air
- nahore ve Swaggeru prehled nabizenych a nenabizenych bank s duvody
- GET /status s prehledem vypadku stahovani u jednotlivych bank
- prazdna promenna prostredi znamena vychozi hodnotu
- popis stahovani v documentation/stahovani.md
This commit is contained in:
JiriUhlir
2026-11-04 15:33:21 +01:00
parent 4c81c5bb34
commit e39f52f027
21 changed files with 835 additions and 82 deletions
+7 -1
View File
@@ -1,10 +1,12 @@
"""Shared building blocks of the source parsers."""
from collections.abc import Callable
from collections.abc import Awaitable, Callable
from dataclasses import dataclass
from typing import Any
from zoneinfo import ZoneInfo
import httpx
from app.models import Origin, ParsedRates, Rate
# Dividing by the quoted amount (for example 100 JPY) must not lose precision
@@ -23,6 +25,10 @@ class Source:
parse: Callable[[str], ParsedRates]
# When set, the source is requested with POST and this JSON body instead of GET.
request_json: dict[str, Any] | None = None
# When set, replaces the single request, for sources that need several of them.
fetch: Callable[[httpx.AsyncClient], Awaitable[str]] | None = None
# Shown in the API documentation when consumers should know something about the source.
note: str | None = None
def parse_comma_decimal(value: str) -> float: