-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathscoring.py
More file actions
executable file
·32 lines (24 loc) · 981 Bytes
/
scoring.py
File metadata and controls
executable file
·32 lines (24 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python3
from __future__ import print_function
import sys
from parser.json_output import jsonwriter_extremes, jsonwriter_site, jsonwriter_list
from parser.parser import parse_json_glob
from parser.util import log
YEAR = 2025
if __name__ == "__main__":
# display help:
if len(sys.argv) <= 1:
log(
"Usage: scoring.py json print json data for all boats to orc-data.json\n"
" scoring.py site Export data for gh-pages site to site/index.json and site/data/*.json"
)
sys.exit(1)
pattern = f"data/{YEAR}/*{YEAR}.json"
rms = parse_json_glob(pattern)
log(f"Loaded a total of {len(rms)} boats with pattern {pattern}.")
if sys.argv[1] == "json":
jsonwriter_list(rms)
elif sys.argv[1] == "site":
jsonwriter_site(rms)
jsonwriter_extremes()
log("Exported for website: site/index.json, site/extremes.json and site/data/*.json")