{"categories":[{"label":"Libraries","url":"https://skillfed.io/packages/category/software-development-libraries/6"}],"enrichment":{"capability":"Lagom is a lightweight dependency injection container that auto-wires dependencies based on type hints, requiring zero configuration for most use cases.","skillfed_tags":["dependency-injection","type-hints","ioc-container"],"use_cases":["Auto-wire dependencies in a web application by registering handler functions with the container and letting it inject services based on type hints.","Manage expensive-to-create singleton instances (database connections, caches) by registering them once and reusing across the application.","Gradually introduce dependency injection into an existing codebase by adding type hints to constructors without refactoring the rest of the code.","Build testable code by swapping real dependencies with mocks in test containers without modifying production classes.","Structure async Python applications where coroutines need injected dependencies resolved at startup."],"what_it_does":"Lagom is a dependency injection container that uses Python type hints to automatically construct and wire dependencies with minimal configuration. Most of your application code remains unaware of the container; Lagom is invoked only at the top level to assemble the dependency graph. It supports type-based auto-wiring where the container inspects `__init__` method type annotations and recursively builds instances, explicit singleton registration, lambda-based factory functions, and decorators for integrating with web frameworks and async code.\n\nThe design philosophy emphasizes minimal intrusion into existing code\u2014you don't need to modify your classes to use Lagom, only to add type hints if you want auto-wiring. It's thread-safe at runtime and fully integrated with mypy for static type checking, making it suitable for both small scripts and larger applications that need structured dependency management without heavyweight framework overhead.","worth_installing":"Yes. Lagom is a solid choice for projects needing lightweight dependency injection without framework overhead. Zero runtime dependencies, active maintenance, broad Python version support, and a permissive MIT license make it low-risk. The type-hint-based design integrates well with modern Python tooling. Best suited for teams comfortable with type annotations and seeking minimal configuration; not necessary for very small scripts but valuable for any structured application."},"id":"lagom","links":{"html":"https://skillfed.io/packages/lagom","md":"https://skillfed.io/packages/lagom.md","pypi":"https://pypi.org/project/lagom/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2025-07-16","license_spdx":null,"license_treatment":"permissive","name":"lagom","python_support":"supports_current","summary":"Lagom is a dependency injection container designed to give you 'just enough' help with building your dependencies."},"popularity":{"monthly_downloads":338072,"position":7439,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"2.7.7"}
