{"categories":[{"label":"Software Development","url":"https://skillfed.io/packages/category/software-development/4"}],"enrichment":{"capability":"Registers runtime hooks in AWS Lambda SnapStart-enabled Python functions to execute code before snapshots are taken and after snapshots are restored.","skillfed_tags":["aws-lambda","snapstart","serverless"],"use_cases":["Initialize database connections or connection pools after snapshot restore to avoid stale connections.","Warm up external API clients or SDKs after restore to ensure fresh authentication and state.","Clean up temporary resources or close file handles before snapshot to prevent state corruption.","Establish logging or monitoring context after restore for accurate request tracing.","Reload configuration or environment-specific settings after restore in multi-environment deployments."],"what_it_does":"Snapshot Restore for Python is a lightweight library that lets you hook into AWS Lambda's SnapStart lifecycle by registering code to run before a snapshot is captured and after it is restored. It provides two decorators (`@register_before_snapshot` and `@register_after_restore`) and corresponding function-based registration methods to control initialization and cleanup around snapshot boundaries. The library has no runtime dependencies and is already bundled in Lambda runtime environments, making it a zero-friction addition to SnapStart-enabled functions.\n\nThe main use case is optimizing Lambda cold starts by deferring expensive initialization (database connections, external API calls, resource setup) until after a snapshot is restored, rather than on every invocation. BeforeSnapshot hooks run in reverse registration order; AfterRestore hooks run in registration order. Hooks must be registered at module level to be recognized; registering them inside the handler or in unimported files will be silently ignored.","worth_installing":"Yes, if you are using AWS Lambda SnapStart with Python. The library is already pre-installed in Lambda runtimes, so you only need to add it to local development dependencies for testing. It has no external dependencies, a permissive license, and solves a specific optimization problem. Maintenance is dormant but the API is stable and the scope is narrow, so active updates are not critical."},"id":"snapshot-restore-py","links":{"html":"https://skillfed.io/packages/snapshot-restore-py","md":"https://skillfed.io/packages/snapshot-restore-py.md","pypi":"https://pypi.org/project/snapshot-restore-py/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2024-11-13","license_spdx":null,"license_treatment":"permissive","name":"snapshot-restore-py","python_support":"supports_current","summary":"Runtime Hooks for AWS Lambda SnapStart - Python"},"popularity":{"monthly_downloads":2681307,"position":2943,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"1.0.0"}
