-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwrite_aircraft.py
More file actions
35 lines (30 loc) · 870 Bytes
/
write_aircraft.py
File metadata and controls
35 lines (30 loc) · 870 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
33
34
35
# Creates a markdown file with aircraft information from mrast.json and rast.json
import json
with open("src/rast.json") as f:
rast = json.load(f)
with open("src/mrast.json") as f:
mrast = json.load(f)
with open("aircraft.md", "w+") as f:
total_aircraft = len(rast + mrast)
f.write(f"**Total aircraft: {total_aircraft}**\n\n")
f.write(f"**[RAST](#RAST): {len(rast)}**\n\n")
f.write(f"**[mRAST](#mRAST): {len(mrast)}**\n\n")
f.write(
"**Click on a spec to fast travel.**\n**Click on an aircraft to view images.**\n\n"
)
f.write("## RAST:\n")
for i in rast:
f.write(
f"""
### [{i["name"]}]({i["image"]})
**Full name: {i["full"]}**
"""
)
f.write("## mRAST:\n")
for i in mrast:
f.write(
f"""
### [{i["name"]}]({i["image"]})
**Full name: {i["full"]}**
"""
)