|
|
@@ -1,4 +1,5 @@
|
|
|
from __future__ import annotations
|
|
|
+import httpx
|
|
|
|
|
|
import collections
|
|
|
import dataclasses
|
|
|
@@ -29,6 +30,11 @@ def main() -> None:
|
|
|
with open(f'www/data/company-data-{month}.json', 'w') as f:
|
|
|
json.dump(company_data, f)
|
|
|
|
|
|
+ response = httpx.get('https://api.fnar.net/material').raise_for_status()
|
|
|
+ tickers = frozenset(mat['Ticker'] for mat in response.json() if mat['Ticker'] != 'CMK')
|
|
|
+ if missing := tickers - prod_data.keys():
|
|
|
+ print('warning: missing production data for tickers', missing)
|
|
|
+
|
|
|
def read_data(f: typing.TextIO) -> dict[str, list[Row]]:
|
|
|
data: dict[str, list[Row]] = collections.defaultdict(list)
|
|
|
reader = csv.reader(f)
|