raylu 2 недель назад
Родитель
Сommit
b58ab6beaa
1 измененных файлов с 6 добавлено и 0 удалено
  1. 6 0
      py/prepare.py

+ 6 - 0
py/prepare.py

@@ -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)