aboutsummaryrefslogtreecommitdiffstats
path: root/fnme/data.py
diff options
context:
space:
mode:
authorAlex Schofield <git@ajschof.me>2026-05-03 18:31:26 +0100
committerAlex Schofield <git@ajschof.me>2026-05-03 18:31:26 +0100
commitd0e905285691d73f2cf7e45a88dbadf631620f0a (patch)
tree3de262bd346732f8813252e8cf38c379cbd1d250 /fnme/data.py
parente6b342749ea516c536973b828b5f5eef951b4796 (diff)
downloadfuelnearme-d0e905285691d73f2cf7e45a88dbadf631620f0a.tar.gz
fuelnearme-d0e905285691d73f2cf7e45a88dbadf631620f0a.zip
move all logic into fnme folder
Diffstat (limited to 'fnme/data.py')
-rw-r--r--fnme/data.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/fnme/data.py b/fnme/data.py
index e69de29..369d80f 100644
--- a/fnme/data.py
+++ b/fnme/data.py
@@ -0,0 +1,12 @@
+from io import StringIO
+from typing import Optional
+
+import pandas as pd
+import requests
+from 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