aboutsummaryrefslogtreecommitdiffstats
path: root/fnme/data.py
diff options
context:
space:
mode:
authorAlex Schofield <git@ajschof.me>2026-05-03 19:56:20 +0100
committerAlex Schofield <git@ajschof.me>2026-05-03 19:56:20 +0100
commitcd38f633c2730804f502cb5b0f461c79b906cd53 (patch)
tree93fd19349e0f60ca4d8708ead9014a3cb9e9c50a /fnme/data.py
parent35b68e14162c722c3103f2a6168f0ab205e9c2c2 (diff)
parent4264ced9fa14b689acc18169b2c1cae72d3ce667 (diff)
downloadfuelnearme-cd38f633c2730804f502cb5b0f461c79b906cd53.tar.gz
fuelnearme-cd38f633c2730804f502cb5b0f461c79b906cd53.zip
merge: uv-migration into main
Diffstat (limited to 'fnme/data.py')
-rw-r--r--fnme/data.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/fnme/data.py b/fnme/data.py
new file mode 100644
index 0000000..bdec6df
--- /dev/null
+++ b/fnme/data.py
@@ -0,0 +1,13 @@
+from io import StringIO
+from typing import Optional
+
+import pandas as pd
+import requests
+
+from fnme.constants import ENDPOINT, HEADERS
+
+
+def get_latest_data() -> tuple[pd.DataFrame, Optional[str]]:
+ response = requests.get(ENDPOINT, headers=HEADERS, timeout=10)
+ response.raise_for_status()
+ return pd.read_csv(StringIO(response.text)), response.headers.get("Last-Modified")
git.ajschof.me — hosted by ajschofield — powered by cgit