|
|
@@ -0,0 +1,23 @@
|
|
|
+from __future__ import annotations
|
|
|
+
|
|
|
+import typing
|
|
|
+
|
|
|
+import cache
|
|
|
+import integration
|
|
|
+
|
|
|
+
|
|
|
+def main() -> None:
|
|
|
+ ship_data: typing.Mapping[str, ShipData] = cache.get(
|
|
|
+ f'https://prun.raylu.net/stats/data/ship-data-{integration.pmmg_month()}.json', expiry=cache.ONE_DAY)
|
|
|
+ coid_users: dict[str, str] = {company_id: d['Username']
|
|
|
+ for company_id, d in cache.get('https://prun.raylu.net/stats/data/knownCompanies.json', expiry=cache.ONE_DAY).items()}
|
|
|
+
|
|
|
+ for company_id, data in ship_data.items():
|
|
|
+ username = coid_users.get(company_id, '')
|
|
|
+ print(f'{username:20} {data["ships"]:>3}')
|
|
|
+
|
|
|
+class ShipData(typing.TypedDict):
|
|
|
+ ships: int
|
|
|
+
|
|
|
+if __name__ == '__main__':
|
|
|
+ main()
|