Python code that interacts with the Chicago Transit Agency's bus and train tracker API.
The purpose of this project is to sit in a continuous loop and hit the public CTA API every X minutes to collect fix information on CTA assets.
Just want the historical CTA fix data? Check out the ctaData project.
External packages needed:
xmltodict (sudo pip install xmltodict)
boto (sudo pip install boto)
There are two config files in the ./config directory. Drop the '_template' part of the filename, and change the settings in the file to your preference.
You will need an official CTA API key. You can get it here. Once acquired, put it in ./config/ctaTracker.conf
You can launch the app using ./scripts/fetch_template. Logging goes into ./logs and data into ./data, by default.
./scripts/monitor.sh is a support script used to monitor the task. Use this in conjunction with cron. Be careful of the relative paths included in this file.
./src/eod.py and ./scripts/eod_template_.sh are designed to run once a day after midnight. This task archives the previous days data, and uploads it to S3. Rename eod_template.sh to eod.sh and put an entry to execute it in cron. Be careful of the relative paths included in ./config/eod.config .