AWS Lambda code that scrapes schedule from MBA League website and returns .ics calendar with games.
just testThe project uses Ruff for linting and formatting, all linters can be run with just:
just lint_full
just lint_full_ff # (fast-fail mode)
just all # (lint + tests)
just all_ff # (lint + tests in fast-fail mode)The project includes a build system that packages the application for AWS Lambda deployment:
just buildThis command:
- Clears the previous build directory (
build/pkg) - Generates a frozen requirements file without dev dependencies
- Installs all dependencies targeting
x86_64-manylinux2014platform (compatible with AWS Lambda) - Copies the lambda handler shim (
lambda_function.py) to the package - Creates a timestamped zip file in the
build/directory (e.g.,mba_scraper_20260201_005935.zip)
The resulting zip file contains:
- All Python dependencies
- The
mba_scraperpackage with your application code - A
lambda_function.pyshim that exposes the handler
The project uses a shim file (lambda_function.py) at the root level to expose the Lambda handler:
This allows AWS Lambda to use the default handler configuration lambda_function.lambda_handler while keeping the actual implementation inside the mba_scraper package.
Package Structure:
build/pkg/
├── lambda_function.py # Shim that exposes the handler
├── mba_scraper/
│ ├── __init__.py
│ ├── lambda_function.py # Actual handler implementation
│ └── ...
├── aws_lambda_powertools/
└── ... (other dependencies)
Note: The shim file can be safely deleted if you update the AWS Lambda Runtime settings → Handler configuration to point directly to mba_scraper.lambda_function.lambda_handler.