Initial commit: Robot ökoszisztéma v2.0 - Stabilizált jármű és szerviz robotok
This commit is contained in:
27
backend/app/test_outside/rdw_zt646p_test.py
Executable file
27
backend/app/test_outside/rdw_zt646p_test.py
Executable file
@@ -0,0 +1,27 @@
|
||||
import httpx
|
||||
import asyncio
|
||||
|
||||
async def get_full_vehicle_data(kenteken: str):
|
||||
# A legfontosabb táblák listája
|
||||
resources = {
|
||||
"Alapadatok": "m9d7-ebf2",
|
||||
"Üzemanyag": "826y-p86p",
|
||||
"Műszaki": "8ys7-d773"
|
||||
}
|
||||
|
||||
kenteken = kenteken.upper().replace("-", "")
|
||||
|
||||
async with httpx.AsyncClient() as client:
|
||||
for name, res_id in resources.items():
|
||||
url = f"https://opendata.rdw.nl/resource/{res_id}.json?kenteken={kenteken}"
|
||||
resp = await client.get(url)
|
||||
|
||||
if resp.status_code == 200 and resp.json():
|
||||
print(f"--- {name} ({res_id}) ---")
|
||||
print(json.dumps(resp.json()[0], indent=2))
|
||||
else:
|
||||
print(f"--- {name} ({res_id}): Nincs adat vagy 404 ---")
|
||||
|
||||
if __name__ == "__main__":
|
||||
import json
|
||||
asyncio.run(get_full_vehicle_data("ZT646P")) # Teszt rendszám
|
||||
Reference in New Issue
Block a user