This repository will contain historical data on the Bay Area Rapid Transit, including ridership, fares, and route frequency.
The website for accessing the data online is bart.vipulnaik.com.
Sources I am using for data:
- Ridership
- Historical fare and route data: 2016, 2014, 2012, 2009, 2008, 2005. The data is mirrored in the faresandschedules folder here.
This section is for people who want to set up a local mirror of the entertainment and self-education portal (e.g., for development purposes) or want to load up the data into a local database to run their own queries.
Note that the passwordFile.inc file in
access-portal/backend/globalVariables is excluded from the Git
repository, but you can modify a corresponding dummy password file at
dummyPasswordFile.inc:
cp access-portal/backend/globalVariables/{dummyPasswordFile.inc,passwordFile.inc}
vi access-portal/backend/globalVariables/passwordFile.inc # change to add database login infoThe database name is present both in dummyPasswordFile.inc and in the
Makefile, so if you want a name other than bart, you should edit the
name in both places.
You can create the bart database either directly in MySQL or by
running this from the root folder of this repository, after updating
MYSQL_ARGS in the Makefile (such as -u<username> -p<password>):
make initInstead of editing the Makefile, you can also pass in the arguments to make:
make MYSQL_ARGS=<args> initOnce you already have the ese SQL database set up, you can update
the MYSQL_ARGS in the Makefile (such as -u<username> -p<password>)
and you can then load the data using:
make reset && make readInstead of editing the Makefile, you can also pass in the arguments to each make:
make MYSQL_ARGS=<args> reset && make MYSQL_ARGS=<args> readIf you just want to refresh the ridership data (that we do every few months):
make refresh_ridershipTo get files for table sorting, run:
make fetch_table_sortingYou can remove these files with make clean_table_sorting.
To get AnchorJS, run:
make fetch_anchorjsYou can remove these files with make clean_anchorjs.
For the graphing, you need to make sure you have python3 working,
and you also need to install some packages. You can install the
packages with pip3 as follows:
pip3 install argparse pandas numpy matplotlibIf for whatever reason you don't have pip3 installed, you need to
install it first.