diff --git a/README.md b/README.md index 5986175f..c75f125f 100644 --- a/README.md +++ b/README.md @@ -21,10 +21,18 @@ This is the repository for the TransitMatters Data Dashboard. Client code is wri 1. Add `MBTA_V3_API_KEY` to your shell environment: - `export MBTA_V3_API_KEY='KEY'` in ~/.bashrc or ~/.zshrc -2. Add your AWS credentials (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY) to your shell environment, OR add them to a .boto config file with awscli command `aws configure`. -3. In the root directory, run `npm install` to install all frontend and backend dependencies -4. Run `npm start` to start both the JavaScript development server and the Python backend at the same time. -5. Navigate to [http://localhost:3000](http://localhost:3000) (or the url provided after running `npm start`) +2. In the root directory, run `npm install` to install all frontend and backend dependencies +3. Run `npm start` to start both the JavaScript development server and the Python backend at the same time. +4. Navigate to [http://localhost:3000](http://localhost:3000) (or the url provided after running `npm start`) + +### AWS Setup + +If you have access to AWS credentials, add them to your local setup for a better development experience + +1. Add your AWS credentials (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY) to your shell environment, OR add them to a .boto config file with awscli command `aws configure`. +2. Ensure that AWS is set to read from/to `us-east-1` via `export AWS_DEFAULT_REGION=us-east-1` or with an aws config + +AWS access is not required for development, but may be required for certain charts and data to appear ## Deployment Instructions diff --git a/server/chalicelib/dynamo.py b/server/chalicelib/dynamo.py index 6fb79b84..73b4703e 100644 --- a/server/chalicelib/dynamo.py +++ b/server/chalicelib/dynamo.py @@ -10,13 +10,13 @@ dynamodb = boto3.resource("dynamodb") -def query_daily_trips_on_route(table_name, route, start_date, end_date): +def query_daily_trips_on_route(table_name: str, route, start_date: str | date, end_date: str | date): table = dynamodb.Table(table_name) response = table.query(KeyConditionExpression=Key("route").eq(route) & Key("date").between(start_date, end_date)) return ddb_json.loads(response["Items"]) -def query_daily_trips_on_line(table_name, line, start_date, end_date): +def query_daily_trips_on_line(table_name: str, line: str, start_date: str | date, end_date: str | date): route_keys = constants.LINE_TO_ROUTE_MAP[line] with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor: futures = [