The Python-based Amtrak and Weather Underground (PAWU) tool is designed to collect Amtrak passenger train data from the Amtrak Status Maps Archive Database (ASMAD) and weather information from Weather Underground. PAWU facilitates users to retrieve both departure and arrival times of any Amtrak passenger trains from ASMAD by simply giving either a list of Amtrak train numbers or station codes, and a specific period (start and end dates). PAWU then accommodates users to automatically search and retrieve all weather information available on Weather Underground of a weather station closest to each relevant station. Furthermore, PAWU automatically manipulates data from the two data sources—stored in different formats—into a MySQL relational database on the users’ local memory. This MySQL database is less complex and more suitable for further analysis.
The files available below and on GitHub includes all required scripts and configuration files, as well as csv file of all Amtrak stations.
MySQL. For Windows: it is freely available at https://dev.mysql.com/downloads/installer/; it is recommended to download and install via MySQL installer community together with MySQL Workbench. For OS X: instructions and guidelines are provided at https://dev.mysql.com/doc/refman/5.6/en/osx-installation.html. For Linux, instructions and guidelines are available at https://dev.mysql.com/doc/refman/8.0/en/linux-installation.html.
The code was developed in Python 3.5.
Please contact us if you have any questions about the code.