{"id":23945,"library":"lambda-warmer-py","title":"Lambda Warmer","description":"A Python decorator to keep AWS Lambda functions warm and monitor cold starts. The decorator intercepts warmer invocations (typically from a CloudWatch Event) and returns a no-op response, while measuring cold start duration. Current version 0.6.0. Release cadence is low, last updated in 2020.","status":"active","version":"0.6.0","language":"python","source_language":"en","source_url":"https://github.com/robhowley/lambda-warmer-py","tags":["aws-lambda","cold-start","warmer","decorator"],"install":[{"cmd":"pip install lambda-warmer-py","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"note":"The package name uses underscores, not hyphens.","wrong":"from lambda_warmer_py import warmer","symbol":"warmer","correct":"from lambda_warmer import warmer"}],"quickstart":{"code":"from lambda_warmer import warmer\n\n@warmer\n\ndef handler(event, context):\n    return {'statusCode': 200, 'body': 'Hello World'}","lang":"python","description":"Decorate your Lambda handler with @warmer to handle warm-up pings and log cold start metrics."},"warnings":[{"fix":"Ensure @warmer is the outermost decorator (closest to the function definition) or applied directly to the raw handler.","message":"The warmer decorator must be applied to the handler function that Lambda calls directly. If you wrap the handler inside another decorator, the warmer may not intercept invocations correctly.","severity":"gotcha","affected_versions":"all"},{"fix":"Attach an IAM policy granting cloudwatch:PutMetricData to your Lambda execution role, or override the metric publishing logic.","message":"The library uses boto3 to publish custom metrics to CloudWatch, but this requires IAM permissions (cloudwatch:PutMetricData). Without proper permissions, the decorator silently fails.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install with 'pip install lambda-warmer-py' and import as 'from lambda_warmer import warmer'.","cause":"Package is not installed or import path is wrong.","error":"ModuleNotFoundError: No module named 'lambda_warmer'"},{"fix":"Set AWS credentials via environment variables or use an IAM role when deploying to Lambda.","cause":"Lambda environment lacks AWS credentials (e.g., when running locally).","error":"Unable to locate credentials"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}