diff options
| author | Alex Schofield <git@ajschof.me> | 2026-05-03 18:31:26 +0100 |
|---|---|---|
| committer | Alex Schofield <git@ajschof.me> | 2026-05-03 18:31:26 +0100 |
| commit | d0e905285691d73f2cf7e45a88dbadf631620f0a (patch) | |
| tree | 3de262bd346732f8813252e8cf38c379cbd1d250 /fnme/data.py | |
| parent | e6b342749ea516c536973b828b5f5eef951b4796 (diff) | |
| download | fuelnearme-d0e905285691d73f2cf7e45a88dbadf631620f0a.tar.gz fuelnearme-d0e905285691d73f2cf7e45a88dbadf631620f0a.zip | |
move all logic into fnme folder
Diffstat (limited to 'fnme/data.py')
| -rw-r--r-- | fnme/data.py | 12 |
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") |
