Skip to content

winstonhoyle/Mapping-WMATA-Fares

Repository files navigation

Mapping-WMATA-Fares

This application helps visualize the confusing fare system of Washington Metropolitan Area Transit Authority (WMATA).

Prerequisites

Building the App

This is a mix of automated CI/CD, Infrastructure as Code (IaC), and manual python due to AWS Free Tier limits.

  1. Create IAM users & roles, a Lambda function, an API Gateway and an S3 bucket

    a. Authenticate aws-cli credentials

    cd infra
    terraform plan
    

    b. Ensure you want these services and users/roles to be created

    terraform apply
    
  2. Populate the bucket, I wanted this to be within an AWS Glue Job but the free tier limit does not allow the type of Glue job needed for IoC

    a. Using the env.sample, populate WMATA_API_KEY from the WMATA API site.

    WMATA_API_KEY=""
    S3_BUCKET="wmata-fares"
    S3_PREFIX="data/"
    

    b. Create a virtual env

    python3.12 -m venv .venv
    source .venv/bin/activate
    

    c. Install requirements.txt

    python3.12 -m pip install -r requirements.txt
    

    d. Run data/upload_files.py

    python3.12 data/upload_files.py
    

    e. Locally you'll see 3 small JSON files, one lines, one stations, one fares. On your S3 Bucket you'll see all 3 within s3://wmata-fares/data/

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published