tessl install tessl/pypi-aws-lambda-powertools@3.19.0Comprehensive developer toolkit implementing serverless best practices for AWS Lambda functions in Python
Agent Success
Agent success rate when using this tile
89%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.22x
Baseline
Agent success rate without this tile
73%
A Lambda function that processes large CSV files stored in S3 by reading specific rows without loading the entire file into memory.
Your Lambda function receives events containing S3 bucket and key information for CSV files that may be larger than the available Lambda memory. The function must read and process these files efficiently.
The Lambda handler should accept events in the following format:
{
"bucket": "my-bucket",
"key": "path/to/file.csv.gz",
"row_index": 100 # optional, which row to read (0-indexed after header)
}Your handler should:
@generates
def lambda_handler(event: dict, context) -> dict:
"""
Process CSV files from S3 efficiently using streaming.
Args:
event: Lambda event containing 'bucket', 'key', and optional 'row_index'
context: Lambda context object
Returns:
Dictionary containing the processed row data
"""
passProvides S3 streaming capabilities with seekable IO and transformation support.