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; it is recommended to download and install via MySQL installer community together with MySQL Workbench. For OS X: instructions and guidelines are provided at For Linux, instructions and guidelines are available at

The code was developed in Python 3.5.

Please contact us if you have any questions about the code.

version 1.00beta: GitHub |Download Code | Publication

Python-based Amtrak and Weather Underground (PAWU) Picture