Monitors the TSA Published Statistics on the FOIA Electronic Reading Room site. Ths codebase supports the processing of PDF files to JSON and CSV files. With this information, you can see TSA Throughput history. The following animation was created using this data. See sample input and output files in the /data folder.
Read Three Years of TSA Throughput Data.
Eventually this will be automated utilizing the below architecture
At a high level, the project is organized into 3 main folders:
If you don't care about the details, and just want to update the data to the latest available file published, navigate to the /scripts folder and issue the following command
./updateData.sh <latest filename>
./updateData.sh tsa-throughput-april-19-2020-to-april-25-2020.pdf
This will convert the .pdf file to json and then create .csv files and figures based on the latest data.
The updateData.sh script makes it easy to just get'er done. It's contains a couple of other scripts to convert from PDF to JSON, and another to build CSV files.
Navigate to the /scripts folder and issue the following command
./cvtPdfToJson.sh ../data/tsa-throughput-april-19-2020-to-april-25-2020.pdf
Navigate to the /scripts folder and issue the following command
./cvtJsonToCsv.sh
The above command will process all of the files in the /data/raw/tsa/throughput folder and filter based on -a AIRPORTCODE. If you don't use the -a option, it will process all airports.
The repository now includes an automated generation method for creating individual CSV files for each airport. This is achieved through the use of two scripts:
scripts/cvtJsonToCsv.sh
: This script has been updated to dynamically generate CSV files for all airports listed in the JSON data. It iterates over all airport codes in the JSON files and generates CSV files for each airport code found.
scripts/generateAirportCsvs.sh
: A new script that automates the generation of individual CSV files for each airport. It parses JSON data to extract airport codes and uses the modified scripts/cvtJsonToCsv.sh
script to generate CSV files for each airport.
To use the automated generation method to create CSV files for additional airports, run the following command in the /scripts
directory:
./generateAirportCsvs.sh
This will generate CSV files for all airports listed in the JSON data and place them in the appropriate directory.