Skip to content

Commit 3f5912d

Browse files
committed
Add scraping and analyzing plates
1 parent 30f705d commit 3f5912d

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

.github/workflows/scrape.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,16 @@ jobs:
1919
run: |
2020
pip install -r requirements_dev.txt
2121
pip install -r scrape_faa/requirements.txt
22+
2223
- name: Scrape FAA data
2324
working-directory: scrape_faa
2425
run: |
2526
python download.py
27+
- name: Extract CIFP file
28+
working-directory: scrape_faa/download
29+
run: |
30+
7z x CIFP_*.zip
31+
- name: Analyze Plates
32+
run: |
33+
python approach_plate_extract.py scrape_faa/download scrape_faa/download/FAACIFP18
34+

approach_plate_extract.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from plate_analyzer import extract_information_from_plate
22
from plate_analyzer import scrape_faa_dtpp_zip, cifp_analysis
3+
import sys
34

45

56
if __name__ == "__main__":
@@ -8,9 +9,17 @@
89

910
# cifp_analysis.analyze_cifp_file("../../Downloads/faa_dttp/FAACIFP18")
1011

12+
if len(sys.argv) > 1:
13+
folder = sys.argv[1]
14+
cifp_file = sys.argv[2]
15+
else:
16+
folder = "../../Downloads/faa_dttp/250320"
17+
cifp_file = "../../Downloads/faa_dttp/250320/FAACIFP18"
18+
19+
1120
results = scrape_faa_dtpp_zip.analyze_dtpp_zips(
12-
"../../Downloads/faa_dttp/250320",
13-
cifp_file="../../Downloads/faa_dttp/250320/FAACIFP18",
21+
folder,
22+
cifp_file=cifp_file,
1423
)
1524
with open("output.json", "w") as f:
1625
f.write(results.model_dump_json())

0 commit comments

Comments
 (0)