Skip to content

call seek on BytesIO #32

call seek on BytesIO

call seek on BytesIO #32

name: Automate CTA schedule and realtime downloads
on:
push:
branches:
- 'automate-schedule-downloads'
- 'date-range-downloads'
- 'compare-realtime-schedule'
schedule:
# Run every day at 12:30pm CST which is 5:30pm UTC
- cron: 30 17 * * *
env:
PYTHON_VERSION: 3.10.6
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
jobs:
download-cta-schedule-data:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Download and save CTA schedule data
run: |
pip install -r requirements.txt
python -c 'from scrape_data.cta_data_downloads import save_cta_zip; \
save_cta_zip()' \
$AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY
download-transitfeeds-data:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Download and save transitfeeds.com schedule data
run: |
pip install -r requirements.txt
python -c 'from scrape_data.cta_data_downloads import save_transitfeeds_zip; \
save_transitfeeds_zip()' \
$AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY
# save-schedule-daily-summary:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-python@v4
# with:
# python-version: ${{ env.PYTHON_VERSION }}
# - name: 'Save schedule summaries'
# # Test with no date and with date range
# run: |
# pip install -r requirements.txt
# python -c 'from scrape_data.cta_data_downloads import save_sched_daily_summary; \
# save_sched_daily_summary()' $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY
# python -c 'from scrape_data.cta_data_downloads import save_sched_daily_summary; \
# save_sched_daily_summary(["2023-05-20", "2023-08-20"])' $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY
# save-realtime-daily-summary:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-python@v4
# with:
# python-version: ${{ env.PYTHON_VERSION }}
# - name: 'Save realtime summaries'
# run: |
# pip install -r requirements.txt
# python -c 'from scrape_data.cta_data_downloads import save_realtime_daily_summary; \
# save_realtime_daily_summary()' $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY
# save-frontend-map-json:
# runs-on: ubuntu-latest
# needs: [save-realtime-daily-summary, save-schedule-daily-summary]
# strategy:
# fail-fast: false
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-python@v4
# with:
# python-version: ${{ env.PYTHON_VERSION }}
# - name: 'Save data.json for frontend'
# run: |
# pip install -r requirements.txt
# python -c 'from scrape_data.cta_data_downloads import compare_realtime_sched; \
# compare_realtime_sched()' $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY