Coverage for src\pncp\utils.py: 100%

1 from typing import Any

2

3 import httpx

4

5

6 def get_many(url: str, params: dict[str, Any] | None = None) -> list[dict[str, Any]]:

7 with httpx.Client(timeout=10) as client:

8 response = client.get(url, params=params)

9 response.raise_for_status()

10 return response.json()

11

12

13 def get_one(url: str, params: dict[str, Any] | None = None) -> dict[str, Any]:

14 with httpx.Client(timeout=10) as client:

15 response = client.get(url, params=params)

16 response.raise_for_status()

17 return response.json()