{
  "id": "task_libraries:dependency-injection/python",
  "path": "/exapedia/python-dependency-injection-libraries",
  "template": {
    "id": "task_libraries",
    "version": 4
  },
  "title": "Python dependency injection libraries",
  "answer": [
    {
      "t": "text",
      "text": "Python dependency injection libraries supply the objects a class or function needs instead of letting it construct them itself. A container registers how to build each dependency and resolves the full graph when the application asks for an object. These libraries let developers swap databases, clients, and other services in tests without changing application code."
    }
  ],
  "breadcrumb": [
    {
      "label": "Tools"
    },
    {
      "label": "Python dependency injection libraries"
    }
  ],
  "sections": [
    {
      "id": "libraries_popularity",
      "anchor": "popularity",
      "heading": "Popularity",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Monthly downloads",
            "Stars",
            "Last release",
            "License"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#dependency-injector",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F133"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F134"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F140"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F137"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F135"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#injector",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F148"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F149"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F155"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F152"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F150"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#svcs",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F163"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F164"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F167"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F165"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#inject",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F181"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F182"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F188"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F185"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F183"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#fast-depends",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F197"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F198"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F206"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F201"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F199"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#dishka",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F214"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F215"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F221"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F218"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F216"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#lagom",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F229"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F230"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F238"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F233"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F231"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#wireup",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F246"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F247"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F255"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F250"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F248"
                }
              ]
            ]
          ],
          "variant": "pop",
          "caption": [
            {
              "t": "text",
              "text": "Downloads: "
            },
            {
              "t": "text",
              "text": "PyPI"
            },
            {
              "t": "text",
              "text": ", last thirty days. Stars and releases: GitHub. Amber: no release in over a year."
            }
          ]
        }
      ],
      "note": [
        {
          "t": "link",
          "href": "#dependency-injector",
          "label": [
            {
              "t": "text",
              "text": "Dependency Injector"
            }
          ]
        },
        {
          "t": "text",
          "text": " has the most monthly downloads in this comparison, at "
        },
        {
          "t": "fact",
          "fact": "F134"
        },
        {
          "t": "text",
          "text": "."
        }
      ]
    },
    {
      "id": "libraries_capabilities",
      "anchor": "capabilities",
      "heading": "Capabilities",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Async factories",
            "Resource cleanup"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#dependency-injector",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F133"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F141"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F142"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#injector",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F148"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F156"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F157"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#svcs",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F163"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F173"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F174"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#inject",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F181"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F189"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F190"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#fast-depends",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F197"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F207"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F208"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#dishka",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F214"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F222"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F223"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#lagom",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F229"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F239"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F240"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#wireup",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F246"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F256"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F257"
                }
              ]
            ]
          ],
          "variant": "cap"
        }
      ]
    },
    {
      "id": "libraries_entries",
      "anchor": "libraries",
      "heading": "Libraries",
      "blocks": [
        {
          "b": "entry",
          "anchor": "dependency-injector",
          "name": [
            {
              "t": "fact",
              "fact": "F133"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/ets-labs/python-dependency-injector"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/dependency-injector"
            },
            {
              "label": "Docs",
              "href": "https://python-dependency-injector.ets-labs.org/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F12"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F134"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F140"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F136"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F135"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://python-dependency-injector.ets-labs.org/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F133"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F13"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F14"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F15"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F16"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F17"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F18"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F19"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F20"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F146"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F147"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/mlco2/codecarbon",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F146"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def init_container():\n    container = ServerContainer()\n    container.wire(\n        modules=[\n            emissions,\n            runs,\n            experiments,\n            projects,\n            project_api_tokens,\n            organizations,\n            telemetry,\n            authenticate,\n            auth_service,\n        ]\n    )\n    return container\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/mlco2/codecarbon/blob/9b02bdc8bafd57023e10e7ff0388ab86b329831e/carbonserver/main.py#L62-L77",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F145"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20dependency-injector%20for%20dependency%20binding%20and%20resource%20lifecycle&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F133"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from dependency_injector import providers\n\nservice = providers.Factory(dict, message='hello')\nprint(service())\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://python-dependency-injector.ets-labs.org/providers/factory.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "resource.py"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F138"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "injector",
          "name": [
            {
              "t": "fact",
              "fact": "F148"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/python-injector/injector"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/injector"
            },
            {
              "label": "Docs",
              "href": "https://github.com/python-injector/injector/blob/master/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F36"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F149"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F155"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F151"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F150"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/python-injector/injector/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F148"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F37"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F38"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F39"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F40"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F41"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F42"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F43"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F44"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F161"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F162"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/zylon-ai/private-gpt",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F161"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def create_application_injector() -> Injector:\n    \"\"\"Create a new injector with the default bindings.\"\"\"\n    _injector = Injector(auto_bind=True)\n    _injector.binder.bind(Settings, to=unsafe_typed_settings)\n    return _injector\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/zylon-ai/private-gpt/blob/9d37a133f1d50e9b10ed527ce198ffd7ded1af70/private_gpt/di.py#L32-L36",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F160"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20injector%20for%20dependency%20binding%20and%20resource%20lifecycle&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F148"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from dataclasses import dataclass\nfrom injector import Injector, inject\nclass Inner:\n    def __init__(self):\n        self.forty_two = 42\n\n@inject\n@dataclass\nclass Outer:\n    inner: Inner\n\ninjector = Injector()\nouter = injector.get(Outer)\nprint(outer.inner.forty_two)  # Prints 42\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/python-injector/injector/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F153"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "svcs",
          "name": [
            {
              "t": "fact",
              "fact": "F163"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/hynek/svcs"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/svcs"
            },
            {
              "label": "Docs",
              "href": "https://svcs.hynek.me/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F170"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F164"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F166"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F165"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://svcs.hynek.me/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F163"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F179"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F180"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/apache/airflow",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F179"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "@svcs.fastapi.lifespan\nasync def lifespan(app: FastAPI, registry: svcs.Registry):\n    app.state.lifespan_called = True\n\n    # According to svcs's docs this shouldn't be needed, but something about SubApps is odd, and we need to\n    # record this here\n    app.state.svcs_registry = registry\n\n    registry.register_factory(JWTGenerator, create_jwt_generator)\n\n    # InProcessExecutionAPI stubs out JWTValidator: don't re-register in that case.\n    if JWTValidator not in registry:\n        # Create an app scoped validator, so that we don't have to fetch it every time\n        registry.register_value(JWTValidator, _jwt_validator(), ping=JWTValidator.status)\n\n    yield\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/apache/airflow/blob/ea289c5bb41a6fa206f23dac210055547ea1bc7d/airflow-core/src/airflow/api_fastapi/execution_api/app.py#L95-L110",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F178"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=svcs%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F163"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import svcs\n\nwith svcs.Registry() as registry:\n    registry.register_value(str, 'hello')\n    with svcs.Container(registry) as services:\n        print(services.get(str))\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://svcs.hynek.me/en/stable/core-concepts.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "core-concepts.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F168"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "inject",
          "name": [
            {
              "t": "fact",
              "fact": "F181"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/ivankorobkov/python-inject"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/inject"
            },
            {
              "label": "Docs",
              "href": "https://github.com/ivankorobkov/python-inject/blob/master/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F61"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F182"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F188"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F184"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F183"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/ivankorobkov/python-inject/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F181"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F62"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F63"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F64"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F65"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F66"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F67"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F68"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F69"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F195"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F196"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/geigi/cozy",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F195"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def configure_inject(self, binder):\n    binder.bind_to_provider(SqliteDatabase, get_db)\n    binder.bind(\"MainWindow\", self.main_window)\n    binder.bind(\"GtkApp\", self.gtk_app)\n    binder.bind(\"MainWindowBuilder\", self.main_window_builder)\n    binder.bind_to_constructor(Gio.Settings, lambda: Gio.Settings(\"com.github.geigi.cozy\"))\n    binder.bind_to_constructor(ApplicationSettings, lambda: ApplicationSettings())\n    binder.bind_to_constructor(Settings, lambda: Settings())\n    binder.bind_to_constructor(\"FilesystemMonitor\", lambda: FilesystemMonitor())\n    binder.bind_to_constructor(OfflineCache, lambda: OfflineCache())\n    binder.bind_to_constructor(Player, lambda: Player())\n    binder.bind_to_constructor(Library, lambda: Library())\n    binder.bind_to_constructor(DatabaseImporter, lambda: DatabaseImporter())\n    binder.bind_to_constructor(LibraryViewModel, lambda: LibraryViewModel())\n    binder.bind_to_constructor(SearchViewModel, lambda: SearchViewModel())\n    binder.bind_to_constructor(Files, lambda: Files())\n    binder.bind_to_constructor(BookDetailViewModel, lambda: BookDetailViewModel())\n    binder.bind_to_constructor(PlaybackControlViewModel, lambda: PlaybackControlViewModel())\n    binder.bind_to_constructor(HeaderbarViewModel, lambda: HeaderbarViewModel())\n    binder.bind_to_constructor(PlaybackSpeedViewModel, lambda: PlaybackSpeedViewModel())\n    binder.bind_to_constructor(SleepTimerViewModel, lambda: SleepTimerViewModel())\n    binder.bind_to_constructor(GstPlayer, lambda: GstPlayer())\n    binder.bind_to_constructor(ToastNotifier, lambda: ToastNotifier())\n    binder.bind_to_constructor(AppViewModel, lambda: AppViewModel())\n    binder.bind_to_constructor(SettingsViewModel, lambda: SettingsViewModel())\n    binder.bind_to_constructor(StoragesViewModel, lambda: StoragesViewModel())\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/geigi/cozy/blob/a4ee50d1cf1aa3ae955d8b9a4e1bd6ae2d3924c3/cozy/app_controller.py#L75-L100",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F194"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20inject%20for%20dependency%20binding%20and%20resource%20lifecycle&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F181"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import inject\n\ninject.configure(lambda binder: binder.bind(str, 'hello'))\nprint(inject.instance(str))\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://pypi.org/pypi/inject/5.5.0/json",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F186"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "fast-depends",
          "name": [
            {
              "t": "fact",
              "fact": "F197"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/Lancetnik/FastDepends"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/fast-depends"
            },
            {
              "label": "Docs",
              "href": "https://lancetnik.github.io/FastDepends/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F204"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F198"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F206"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F200"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F199"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://lancetnik.github.io/FastDepends/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F197"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F212"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F213"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/ag2ai/ag2",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F212"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def build_model(\n    f: Callable[..., Any],\n    *,\n    sync_to_thread: bool = True,\n    serialize_result: bool = True,\n    use_fastdepends_errors: bool = False,\n    provider: Provider | None = None,\n) -> CallModel:\n    return build_call_model(\n        _to_async(f, sync_to_thread=sync_to_thread),\n        dependency_provider=provider if provider is not None else dependency_provider,\n        serializer_cls=PydanticSerializer(\n            pydantic_config={\"arbitrary_types_allowed\": True},\n            use_fastdepends_errors=use_fastdepends_errors,\n        ),\n        serialize_result=serialize_result,\n    )\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/ag2ai/ag2/blob/6d2dd8bab8af873ea29ed759cfacb572466d925e/ag2/utils.py#L30-L46",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F211"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=fast-depends%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F197"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from fast_depends import Depends, inject\n\ndef greeting() -> str:\n    return 'hello'\n\n@inject\ndef show(message: str = Depends(greeting)) -> str:\n    return message\n\nprint(show())\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://api.github.com/repos/Lancetnik/FastDepends/git/blobs/481efabb396d5f24635e4e4c5801d4f1bafa5ca4",
                  "label": [
                    {
                      "t": "text",
                      "text": "use.py"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F202"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "dishka",
          "name": [
            {
              "t": "fact",
              "fact": "F214"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/reagento/dishka"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/dishka"
            },
            {
              "label": "Docs",
              "href": "https://dishka.readthedocs.io/en/stable/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F87"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F215"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F221"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F217"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F216"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://dishka.readthedocs.io/en/stable/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F214"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F88"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F89"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F90"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F91"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F92"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F93"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F94"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F95"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F227"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F228"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/bitcart/bitcart",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F227"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def build_container(\n    settings: Settings,\n    *,\n    extra_providers: Iterable[Provider] = (),\n    context_overrides: dict[type[Any], Any] | None = None,\n    include_plugins: bool = True,\n    **kwargs: Any,\n) -> AsyncContainer:\n    context: dict[type[Any], Any] = {Settings: settings, TasksBroker: broker, ClientTasksBroker: client_tasks_broker}\n    providers = get_providers()\n    providers.extend(extra_providers)\n    if include_plugins:\n        plugin_classes, plugin_providers = load_plugins(settings)\n        plugin_objects = init_plugins(plugin_classes)\n        plugin_context = build_plugin_di_context(plugin_objects)\n        context[PluginObjects] = plugin_objects\n        context.update(cast(dict[type[Any], Any], plugin_context))\n        providers.extend(plugin_providers)\n    if context_overrides:\n        context.update(context_overrides)\n    return make_async_container(\n        *providers,\n        context=context,\n        **kwargs,\n    )\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/bitcart/bitcart/blob/3a83c0a1440260b8bfb3dd90c7b74e808a60fc6a/api/ioc/__init__.py#L20-L44",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F226"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20dishka%20for%20dependency%20binding%20and%20resource%20lifecycle&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F214"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from dishka import Provider, Scope, make_container\n\nclass Service:\n    def __init__(self) -> None:\n        self.message = 'hello'\n\nprovider = Provider(scope=Scope.APP)\nprovider.provide(Service)\ncontainer = make_container(provider)\nprint(container.get(Service).message)\ncontainer.close()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://pypi.org/pypi/dishka/1.10.1/json",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F219"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "lagom",
          "name": [
            {
              "t": "fact",
              "fact": "F229"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/meadsteve/lagom"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/lagom"
            },
            {
              "label": "Docs",
              "href": "https://lagom-di.readthedocs.io/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F236"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F230"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F238"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F232"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F231"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://lagom-di.readthedocs.io/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F229"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F244"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F245"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/emcie-co/parlant",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F244"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def _define_singleton(container: Container, interface: type, implementation: type) -> None:\n    try:\n        container[implementation] = Singleton(implementation)\n\n        if interface != implementation:\n            container[interface] = lambda c: c[implementation]\n    except BaseException:\n        rich.print(\n            rich.text.Text(\n                f\"Error adding {implementation} as implementation for {interface}\",\n                style=\"bold red\",\n            )\n        )\n        raise\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/emcie-co/parlant/blob/ea737442b8ae65854a842542e544fbe7e6144bad/src/parlant/bin/server.py#L534-L547",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F243"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=lagom%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F229"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from lagom import Container\n\nclass Service:\n    def __init__(self) -> None:\n        self.message = 'hello'\n\ncontainer = Container()\nprint(container[Service].message)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://pypi.org/pypi/lagom/2.7.7/json",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F234"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "wireup",
          "name": [
            {
              "t": "fact",
              "fact": "F246"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/maldoinc/wireup"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/wireup"
            },
            {
              "label": "Docs",
              "href": "https://maldoinc.github.io/wireup/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F253"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F247"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F255"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F249"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F248"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://maldoinc.github.io/wireup/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F246"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import wireup\n\n@wireup.injectable\nclass Service:\n    def __init__(self) -> None:\n        self.message = 'hello'\n\ncontainer = wireup.create_sync_container(injectables=[Service])\nprint(container.get(Service).message)\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://pypi.org/pypi/wireup/2.13.1/json",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=wireup%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F246"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F251"
            }
          ]
        }
      ]
    }
  ],
  "questions": [
    {
      "q": "Which Python dependency injection library should I use?",
      "a": [
        {
          "t": "link",
          "href": "#dependency-injector",
          "label": [
            {
              "t": "text",
              "text": "Dependency Injector"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits applications that want an explicit graph of providers and containers. "
        },
        {
          "t": "link",
          "href": "#dishka",
          "label": [
            {
              "t": "text",
              "text": "Dishka"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits applications that need nested scopes with cleanup of resources. "
        },
        {
          "t": "link",
          "href": "#svcs",
          "label": [
            {
              "t": "text",
              "text": "svcs"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits teams that prefer a typed service locator over automatic injection."
        }
      ]
    },
    {
      "q": "How does dependency injection work in Python?",
      "a": [
        {
          "t": "text",
          "text": "A container records how to build each service and passes the built objects into parameters or attributes that declare them. Without a library, applications pass dependencies by hand."
        }
      ]
    },
    {
      "q": "What is Dishka?",
      "a": [
        {
          "t": "link",
          "href": "#dishka",
          "label": [
            {
              "t": "text",
              "text": "Dishka"
            }
          ]
        },
        {
          "t": "text",
          "text": " is a dependency injection framework that builds dependency graphs with scoped caches. Nested scopes finalize generator-based resources when they close."
        }
      ]
    },
    {
      "q": "What is Dependency Injector?",
      "a": [
        {
          "t": "link",
          "href": "#dependency-injector",
          "label": [
            {
              "t": "text",
              "text": "Dependency Injector"
            }
          ]
        },
        {
          "t": "text",
          "text": " assembles application objects from explicit providers and containers, with module wiring to inject them."
        }
      ]
    }
  ],
  "facts": {
    "F1": {
      "label": "Library name, dependency-injector",
      "display": "Dependency Injector",
      "asOf": "2026-11-17"
    },
    "F2": {
      "label": "Monthly downloads, dependency-injector",
      "display": "10.5M",
      "asOf": "2026-11-16"
    },
    "F3": {
      "label": "License, dependency-injector",
      "display": "BSD",
      "asOf": "2026-11-17"
    },
    "F4": {
      "label": "Package release, dependency-injector",
      "display": "4.49.1, Jun 2026",
      "asOf": "2026-06-18"
    },
    "F5": {
      "label": "Package release date, dependency-injector",
      "display": "Jun 2026",
      "asOf": "2026-06-18"
    },
    "F6": {
      "label": "Repository stars, dependency-injector",
      "display": "4.9K",
      "asOf": "2026-11-17"
    },
    "F7": {
      "label": "Factory bindings, dependency-injector",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F8": {
      "label": "Singletons, dependency-injector",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F9": {
      "label": "Async factories, dependency-injector",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F10": {
      "label": "Resource cleanup, dependency-injector",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F11": {
      "label": "Install, dependency-injector",
      "display": "pip install dependency-injector",
      "asOf": "2026-11-17"
    },
    "F12": {
      "label": "What it does, dependency-injector",
      "display": "Assembles application objects using explicit providers and containers.",
      "asOf": "2026-11-17"
    },
    "F13": {
      "label": "strengths lead, dependency-injector",
      "display": "Replaces providers for tests",
      "asOf": "2026-11-17"
    },
    "F14": {
      "label": "strengths, dependency-injector",
      "display": "Override an API-client provider with a test stub.",
      "asOf": "2026-11-17"
    },
    "F15": {
      "label": "strengths lead, dependency-injector",
      "display": "Initializes and closes resources",
      "asOf": "2026-11-17"
    },
    "F16": {
      "label": "strengths, dependency-injector",
      "display": "Use Resource providers for components with startup and shutdown.",
      "asOf": "2026-11-17"
    },
    "F17": {
      "label": "limitations lead, dependency-injector",
      "display": "Ordinary singletons need thread protection",
      "asOf": "2026-11-17"
    },
    "F18": {
      "label": "limitations, dependency-injector",
      "display": "Use ThreadSafeSingleton when multiple threads share a provider.",
      "asOf": "2026-11-17"
    },
    "F19": {
      "label": "limitations lead, dependency-injector",
      "display": "Function resources cannot define shutdown",
      "asOf": "2026-11-17"
    },
    "F20": {
      "label": "limitations, dependency-injector",
      "display": "Use a context manager or generator when cleanup is required.",
      "asOf": "2026-11-17"
    },
    "F21": {
      "label": "Quickstart, dependency-injector",
      "display": "\"\"\"`Resource` provider example.\"\"\"\n\nimport sys\nimport logging\nfrom concurrent.futures import ThreadPoolExecutor\nfrom contextlib import contextmanager\n\nfrom dependency_injector import containers, providers\n\n\n@contextmanager\ndef init_thread_pool(max_workers: int):\n    thread_pool = ThreadPoolExecutor(max_workers=max_workers)\n    yield thread_pool\n    thread_pool.shutdown(wait=True)\n\n\nclass Container(containers.DeclarativeContainer):\n\n    config = providers.Configuration()\n\n    thread_pool = providers.Resource(\n        init_thread_pool,\n        max_workers=config.max_workers,\n    )\n\n    logging = providers.Resource(\n        logging.basicConfig,\n        level=logging.INFO,\n        stream=sys.stdout,\n    )\n\n\nif __name__ == \"__main__\":\n    container = Container(config={\"max_workers\": 4})\n\n    container.init_resources()\n\n    logging.info(\"Resources are initialized\")\n    thread_pool = container.thread_pool()\n    thread_pool.map(print, range(10))\n\n    container.shutdown_resources()\n",
      "asOf": "2026-11-17"
    },
    "F22": {
      "label": "Project function, dependency-injector",
      "display": "def init_container():\n    container = ServerContainer()\n    container.wire(\n        modules=[\n            emissions,\n            runs,\n            experiments,\n            projects,\n            project_api_tokens,\n            organizations,\n            telemetry,\n            authenticate,\n            auth_service,\n        ]\n    )\n    return container\n",
      "asOf": "2026-11-17"
    },
    "F23": {
      "label": "Project function reference, dependency-injector",
      "display": "main.py · init_container()",
      "asOf": "2026-11-17"
    },
    "F24": {
      "label": "Project repository, dependency-injector",
      "display": "mlco2/codecarbon",
      "asOf": "2026-11-17"
    },
    "F25": {
      "label": "Project stars, mlco2/codecarbon",
      "display": "1.9K",
      "asOf": "2026-11-17"
    },
    "F26": {
      "label": "Project push date, mlco2/codecarbon",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F27": {
      "label": "Library name, injector",
      "display": "Injector",
      "asOf": "2026-11-17"
    },
    "F28": {
      "label": "Monthly downloads, injector",
      "display": "3.7M",
      "asOf": "2026-11-16"
    },
    "F29": {
      "label": "License, injector",
      "display": "BSD",
      "asOf": "2026-11-17"
    },
    "F30": {
      "label": "Package release, injector",
      "display": "0.24.0, Jan 2026",
      "asOf": "2026-01-09"
    },
    "F31": {
      "label": "Package release date, injector",
      "display": "Jan 2026",
      "asOf": "2026-01-09"
    },
    "F32": {
      "label": "Repository stars, injector",
      "display": "1.5K",
      "asOf": "2026-11-17"
    },
    "F33": {
      "label": "Factory bindings, injector",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F34": {
      "label": "Singletons, injector",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F35": {
      "label": "Install, injector",
      "display": "pip install injector",
      "asOf": "2026-11-17"
    },
    "F36": {
      "label": "What it does, injector",
      "display": "Resolves Python object dependencies through configured Injector instances.",
      "asOf": "2026-11-17"
    },
    "F37": {
      "label": "strengths lead, injector",
      "display": "Uses separate container instances",
      "asOf": "2026-11-17"
    },
    "F38": {
      "label": "strengths, injector",
      "display": "Keep independent dependency configurations in separate Injector instances.",
      "asOf": "2026-11-17"
    },
    "F39": {
      "label": "strengths lead, injector",
      "display": "Offers custom lifetime scopes",
      "asOf": "2026-11-17"
    },
    "F40": {
      "label": "strengths, injector",
      "display": "Implement Scope.get to cache objects for a chosen lifetime.",
      "asOf": "2026-11-17"
    },
    "F41": {
      "label": "limitations lead, injector",
      "display": "Provider work blocks other injections",
      "asOf": "2026-11-17"
    },
    "F42": {
      "label": "limitations, injector",
      "display": "Keep blocking I/O outside providers to avoid blocking other threads.",
      "asOf": "2026-11-17"
    },
    "F43": {
      "label": "limitations lead, injector",
      "display": "Automatic injection excludes ordinary methods",
      "asOf": "2026-11-17"
    },
    "F44": {
      "label": "limitations, injector",
      "display": "Use constructor injection rather than decorating other object methods.",
      "asOf": "2026-11-17"
    },
    "F45": {
      "label": "Quickstart, injector",
      "display": "from dataclasses import dataclass\nfrom injector import Injector, inject\nclass Inner:\n    def __init__(self):\n        self.forty_two = 42\n\n@inject\n@dataclass\nclass Outer:\n    inner: Inner\n\ninjector = Injector()\nouter = injector.get(Outer)\nprint(outer.inner.forty_two)  # Prints 42\n",
      "asOf": "2026-11-17"
    },
    "F46": {
      "label": "Project function, injector",
      "display": "def create_application_injector() -> Injector:\n    \"\"\"Create a new injector with the default bindings.\"\"\"\n    _injector = Injector(auto_bind=True)\n    _injector.binder.bind(Settings, to=unsafe_typed_settings)\n    return _injector\n",
      "asOf": "2026-11-17"
    },
    "F47": {
      "label": "Project function reference, injector",
      "display": "di.py · create_application_injector()",
      "asOf": "2026-11-17"
    },
    "F48": {
      "label": "Project repository, injector",
      "display": "zylon-ai/private-gpt",
      "asOf": "2026-11-17"
    },
    "F49": {
      "label": "Project stars, zylon-ai/private-gpt",
      "display": "57.6K",
      "asOf": "2026-11-17"
    },
    "F50": {
      "label": "Project push date, zylon-ai/private-gpt",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F51": {
      "label": "Library name, inject",
      "display": "inject",
      "asOf": "2026-11-17"
    },
    "F52": {
      "label": "Monthly downloads, inject",
      "display": "2.7M",
      "asOf": "2026-11-16"
    },
    "F53": {
      "label": "License, inject",
      "display": "Apache-2.0",
      "asOf": "2026-11-17"
    },
    "F54": {
      "label": "Package release, inject",
      "display": "5.5.0, Jul 2026",
      "asOf": "2026-07-13"
    },
    "F55": {
      "label": "Package release date, inject",
      "display": "Jul 2026",
      "asOf": "2026-07-13"
    },
    "F56": {
      "label": "Repository stars, inject",
      "display": "778",
      "asOf": "2026-11-17"
    },
    "F57": {
      "label": "Factory bindings, inject",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F58": {
      "label": "Singletons, inject",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F59": {
      "label": "Resource cleanup, inject",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F60": {
      "label": "Install, inject",
      "display": "pip install inject",
      "asOf": "2026-11-17"
    },
    "F61": {
      "label": "What it does, inject",
      "display": "Injects registered dependencies into parameters or attributes through a shared injector.",
      "asOf": "2026-11-17"
    },
    "F62": {
      "label": "strengths lead, inject",
      "display": "Reads parameter type annotations",
      "asOf": "2026-11-17"
    },
    "F63": {
      "label": "strengths, inject",
      "display": "Use autoparams to resolve annotated function dependencies.",
      "asOf": "2026-11-17"
    },
    "F64": {
      "label": "strengths lead, inject",
      "display": "Supports custom current-user providers",
      "asOf": "2026-11-17"
    },
    "F65": {
      "label": "strengths, inject",
      "display": "Bind a provider to return the current thread’s user.",
      "asOf": "2026-11-17"
    },
    "F66": {
      "label": "limitations lead, inject",
      "display": "Implicit bindings create shared instances",
      "asOf": "2026-11-17"
    },
    "F67": {
      "label": "limitations, inject",
      "display": "Disable runtime bindings to require explicit registrations.",
      "asOf": "2026-11-17"
    },
    "F68": {
      "label": "limitations lead, inject",
      "display": "Configuration is shared",
      "asOf": "2026-11-17"
    },
    "F69": {
      "label": "limitations, inject",
      "display": "Use clear=True when replacing an existing configuration.",
      "asOf": "2026-11-17"
    },
    "F70": {
      "label": "Quickstart, inject",
      "display": "import inject\nimport threading\n\n# Given a user class.\nclass User:\n    pass\n\n# Create a thread-local current user storage.\n_LOCAL = threading.local()\n\ndef get_current_user():\n    return getattr(_LOCAL, 'user', None)\n\ndef set_current_user(user):\n    _LOCAL.user = user\n\n# Bind User to a custom provider.\ninject.configure(lambda binder: binder.bind_to_provider(User, get_current_user))\n\n# Inject the current user.\n@inject.params(user=User)\ndef foo(user):\n    pass\n",
      "asOf": "2026-11-17"
    },
    "F71": {
      "label": "Project function, inject",
      "display": "def configure_inject(self, binder):\n    binder.bind_to_provider(SqliteDatabase, get_db)\n    binder.bind(\"MainWindow\", self.main_window)\n    binder.bind(\"GtkApp\", self.gtk_app)\n    binder.bind(\"MainWindowBuilder\", self.main_window_builder)\n    binder.bind_to_constructor(Gio.Settings, lambda: Gio.Settings(\"com.github.geigi.cozy\"))\n    binder.bind_to_constructor(ApplicationSettings, lambda: ApplicationSettings())\n    binder.bind_to_constructor(Settings, lambda: Settings())\n    binder.bind_to_constructor(\"FilesystemMonitor\", lambda: FilesystemMonitor())\n    binder.bind_to_constructor(OfflineCache, lambda: OfflineCache())\n    binder.bind_to_constructor(Player, lambda: Player())\n    binder.bind_to_constructor(Library, lambda: Library())\n    binder.bind_to_constructor(DatabaseImporter, lambda: DatabaseImporter())\n    binder.bind_to_constructor(LibraryViewModel, lambda: LibraryViewModel())\n    binder.bind_to_constructor(SearchViewModel, lambda: SearchViewModel())\n    binder.bind_to_constructor(Files, lambda: Files())\n    binder.bind_to_constructor(BookDetailViewModel, lambda: BookDetailViewModel())\n    binder.bind_to_constructor(PlaybackControlViewModel, lambda: PlaybackControlViewModel())\n    binder.bind_to_constructor(HeaderbarViewModel, lambda: HeaderbarViewModel())\n    binder.bind_to_constructor(PlaybackSpeedViewModel, lambda: PlaybackSpeedViewModel())\n    binder.bind_to_constructor(SleepTimerViewModel, lambda: SleepTimerViewModel())\n    binder.bind_to_constructor(GstPlayer, lambda: GstPlayer())\n    binder.bind_to_constructor(ToastNotifier, lambda: ToastNotifier())\n    binder.bind_to_constructor(AppViewModel, lambda: AppViewModel())\n    binder.bind_to_constructor(SettingsViewModel, lambda: SettingsViewModel())\n    binder.bind_to_constructor(StoragesViewModel, lambda: StoragesViewModel())\n",
      "asOf": "2026-11-17"
    },
    "F72": {
      "label": "Project function reference, inject",
      "display": "app_controller.py · configure_inject()",
      "asOf": "2026-11-17"
    },
    "F73": {
      "label": "Project repository, inject",
      "display": "geigi/cozy",
      "asOf": "2026-11-17"
    },
    "F74": {
      "label": "Project stars, geigi/cozy",
      "display": "1.2K",
      "asOf": "2026-11-17"
    },
    "F75": {
      "label": "Project push date, geigi/cozy",
      "display": "Jul 2026",
      "asOf": "2026-07-16"
    },
    "F76": {
      "label": "Library name, dishka",
      "display": "dishka",
      "asOf": "2026-11-17"
    },
    "F77": {
      "label": "Monthly downloads, dishka",
      "display": "1.4M",
      "asOf": "2026-11-16"
    },
    "F78": {
      "label": "License, dishka",
      "display": "Apache-2.0",
      "asOf": "2026-11-17"
    },
    "F79": {
      "label": "Package release, dishka",
      "display": "1.10.1, Apr 2026",
      "asOf": "2026-04-25"
    },
    "F80": {
      "label": "Package release date, dishka",
      "display": "Apr 2026",
      "asOf": "2026-04-25"
    },
    "F81": {
      "label": "Repository stars, dishka",
      "display": "1.3K",
      "asOf": "2026-11-17"
    },
    "F82": {
      "label": "Factory bindings, dishka",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F83": {
      "label": "Singletons, dishka",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F84": {
      "label": "Async factories, dishka",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F85": {
      "label": "Resource cleanup, dishka",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F86": {
      "label": "Install, dishka",
      "display": "pip install dishka",
      "asOf": "2026-11-17"
    },
    "F87": {
      "label": "What it does, dishka",
      "display": "Builds dependency graphs with scoped caches and resource finalization.",
      "asOf": "2026-11-17"
    },
    "F88": {
      "label": "strengths lead, dishka",
      "display": "Clears scoped dependency caches",
      "asOf": "2026-11-17"
    },
    "F89": {
      "label": "strengths, dishka",
      "display": "Scope exit clears cached dependencies and finalizes generator factories.",
      "asOf": "2026-11-17"
    },
    "F90": {
      "label": "strengths lead, dishka",
      "display": "Awaits asynchronous factories",
      "asOf": "2026-11-17"
    },
    "F91": {
      "label": "strengths, dishka",
      "display": "Use an async container for synchronous and asynchronous dependency sources.",
      "asOf": "2026-11-17"
    },
    "F92": {
      "label": "limitations lead, dishka",
      "display": "Sync providers block async resolution",
      "asOf": "2026-11-17"
    },
    "F93": {
      "label": "limitations, dishka",
      "display": "Keep network I/O out of synchronous providers in async containers.",
      "asOf": "2026-11-17"
    },
    "F94": {
      "label": "limitations lead, dishka",
      "display": "Concurrent child scopes need locks",
      "asOf": "2026-11-17"
    },
    "F95": {
      "label": "limitations, dishka",
      "display": "Pass a matching lock_factory for concurrently used nested scopes.",
      "asOf": "2026-11-17"
    },
    "F96": {
      "label": "Quickstart, dishka",
      "display": "import sqlite3\nfrom collections.abc import Iterable\nfrom sqlite3 import Connection\nfrom typing import Protocol\n\nfrom dishka import Provider, Scope, make_container, provide\n\n\nclass APIClient:\n    ...\n\n\nclass UserDAO(Protocol):\n    ...\n\n\nclass SQLiteUserDAO(UserDAO):\n    def __init__(self, connection: Connection):\n        ...\n\n\nclass Service:\n    def __init__(self, client: APIClient, user_dao: UserDAO):\n        ...\n\n\nservice_provider = Provider(scope=Scope.REQUEST)\nservice_provider.provide(Service)\nservice_provider.provide(SQLiteUserDAO, provides=UserDAO)\nservice_provider.provide(APIClient, scope=Scope.APP)  # override provider's scope\n\n\nclass ConnectionProvider(Provider):\n    @provide(scope=Scope.REQUEST)\n    def new_connection(self) -> Iterable[Connection]:\n        connection = sqlite3.connect(\":memory:\")\n        yield connection\n        connection.close()\n\n\ncontainer = make_container(service_provider, ConnectionProvider())\n\n# APIClient is bound to Scope.APP, so it can be accessed here\n# or from any scope inside including Scope.REQUEST\nclient = container.get(APIClient)\nclient = container.get(APIClient)  # the same APIClient instance as above\n\n# A sub-container to access shorter-living objects\nwith container() as request_container:\n    # Service, UserDAO implementation, and Connection are bound to Scope.REQUEST,\n    # so they are accessible here. APIClient can also be accessed here\n    service = request_container.get(Service)\n    service = request_container.get(Service)  # the same Service instance as above\n\n# Since we exited the context manager, the sqlite3 connection is now closed\n\n# A new sub-container has a new lifespan for request processing\nwith container() as request_container:\n    service = request_container.get(Service)  # a new Service instance\n\ncontainer.close()\n",
      "asOf": "2026-11-17"
    },
    "F97": {
      "label": "Project function, dishka",
      "display": "def build_container(\n    settings: Settings,\n    *,\n    extra_providers: Iterable[Provider] = (),\n    context_overrides: dict[type[Any], Any] | None = None,\n    include_plugins: bool = True,\n    **kwargs: Any,\n) -> AsyncContainer:\n    context: dict[type[Any], Any] = {Settings: settings, TasksBroker: broker, ClientTasksBroker: client_tasks_broker}\n    providers = get_providers()\n    providers.extend(extra_providers)\n    if include_plugins:\n        plugin_classes, plugin_providers = load_plugins(settings)\n        plugin_objects = init_plugins(plugin_classes)\n        plugin_context = build_plugin_di_context(plugin_objects)\n        context[PluginObjects] = plugin_objects\n        context.update(cast(dict[type[Any], Any], plugin_context))\n        providers.extend(plugin_providers)\n    if context_overrides:\n        context.update(context_overrides)\n    return make_async_container(\n        *providers,\n        context=context,\n        **kwargs,\n    )\n",
      "asOf": "2026-11-17"
    },
    "F98": {
      "label": "Project function reference, dishka",
      "display": "__init__.py · build_container()",
      "asOf": "2026-11-17"
    },
    "F99": {
      "label": "Project repository, dishka",
      "display": "bitcart/bitcart",
      "asOf": "2026-11-17"
    },
    "F100": {
      "label": "Project stars, bitcart/bitcart",
      "display": "1.0K",
      "asOf": "2026-11-17"
    },
    "F101": {
      "label": "Project push date, bitcart/bitcart",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F102": {
      "label": "Developer need",
      "display": "Replacing a provider in tests",
      "asOf": "2026-11-17"
    },
    "F103": {
      "label": "Why choose dependency-injector",
      "display": "explicit provider replacement",
      "asOf": "2026-11-17"
    },
    "F104": {
      "label": "Developer need in introduction",
      "display": "replacing a provider in tests",
      "asOf": "2026-11-17"
    },
    "F105": {
      "label": "Developer need",
      "display": "Keeping independent dependency configurations",
      "asOf": "2026-11-17"
    },
    "F106": {
      "label": "Why choose injector",
      "display": "separate Injector instances",
      "asOf": "2026-11-17"
    },
    "F107": {
      "label": "Developer need in introduction",
      "display": "keeping independent dependency configurations",
      "asOf": "2026-11-17"
    },
    "F108": {
      "label": "When to consider dependency-injector",
      "display": "explicit component startup and shutdown are required",
      "asOf": "2026-11-17"
    },
    "F109": {
      "label": "Developer need",
      "display": "Resolving annotated function parameters",
      "asOf": "2026-11-17"
    },
    "F110": {
      "label": "Why choose inject",
      "display": "autoparams type annotations",
      "asOf": "2026-11-17"
    },
    "F111": {
      "label": "Developer need in introduction",
      "display": "resolving annotated function parameters",
      "asOf": "2026-11-17"
    },
    "F112": {
      "label": "When to consider injector",
      "display": "independent container configurations are needed",
      "asOf": "2026-11-17"
    },
    "F113": {
      "label": "Developer need",
      "display": "Managing scoped resource lifetimes",
      "asOf": "2026-11-17"
    },
    "F114": {
      "label": "Why choose dishka",
      "display": "scope cache and generator finalization",
      "asOf": "2026-11-17"
    },
    "F115": {
      "label": "Developer need in introduction",
      "display": "managing scoped resource lifetimes",
      "asOf": "2026-11-17"
    },
    "F116": {
      "label": "When to consider dependency-injector",
      "display": "overriding explicit providers is the main requirement",
      "asOf": "2026-11-17"
    },
    "F117": {
      "label": "Page introduction",
      "display": "Python dependency injection libraries let application developers construct application objects and supply their dependencies.",
      "asOf": "2026-11-17"
    },
    "F118": {
      "label": "FAQ: Does a singleton provider guarantee thread safety?",
      "display": "Dependency Injector’s ordinary Singleton provider is not thread-safe; ThreadSafeSingleton is its synchronized variant.",
      "asOf": "2026-11-17"
    },
    "F119": {
      "label": "FAQ: Can an ordinary function resource define cleanup?",
      "display": "A Dependency Injector function initializer does not provide custom shutdown; context managers and generators support cleanup phases.",
      "asOf": "2026-11-17"
    },
    "F120": {
      "label": "FAQ: Can resources be initialized asynchronously?",
      "display": "Dependency Injector Resource supports asynchronous initialization and shutdown.",
      "asOf": "2026-11-17"
    },
    "F121": {
      "label": "FAQ: Can resources be initialized asynchronously?",
      "display": "dishka async containers accept both synchronous and asynchronous sources.",
      "asOf": "2026-11-17"
    },
    "F122": {
      "label": "FAQ: Can Injector keep separate configurations?",
      "display": "Each Injector instance can have its own configuration and scoped objects.",
      "asOf": "2026-11-17"
    },
    "F123": {
      "label": "FAQ: Why should Injector providers avoid blocking work?",
      "display": "Dependency resolution holds a lock, so only one thread can use injection at a time.",
      "asOf": "2026-11-17"
    },
    "F124": {
      "label": "FAQ: Does Injector inject ordinary object methods automatically?",
      "display": "Its ordinary injection model excludes non-constructor methods.",
      "asOf": "2026-11-17"
    },
    "F125": {
      "label": "FAQ: How does inject resolve annotated parameters?",
      "display": "Its autoparams decorator uses type annotations.",
      "asOf": "2026-11-17"
    },
    "F126": {
      "label": "FAQ: Why does inject return an unregistered class instance?",
      "display": "Runtime bindings create class singletons automatically; bind_in_runtime=False restricts resolution to explicit bindings.",
      "asOf": "2026-11-17"
    },
    "F127": {
      "label": "FAQ: Why does inject return an unregistered class instance?",
      "display": "The configuration flag prevents accidental default-argument construction.",
      "asOf": "2026-11-17"
    },
    "F128": {
      "label": "FAQ: Can an existing inject configuration be replaced?",
      "display": "configure(clear=True) creates a new injector configuration, and clear removes it.",
      "asOf": "2026-11-17"
    },
    "F129": {
      "label": "FAQ: Does dishka create a fresh object for every get call?",
      "display": "Repeated get calls reuse an instance in the corresponding scope until that scope exits.",
      "asOf": "2026-11-17"
    },
    "F130": {
      "label": "FAQ: Does dishka move synchronous providers to an executor?",
      "display": "Async containers call synchronous sources directly without an executor; avoid network I/O in those functions.",
      "asOf": "2026-11-17"
    },
    "F131": {
      "label": "FAQ: Do concurrent child scopes need synchronization?",
      "display": "dishka can require a matching lock_factory when child scopes run concurrently.",
      "asOf": "2026-11-17"
    },
    "F132": {
      "label": "FAQ: Do concurrent child scopes need synchronization?",
      "display": "The top-level APP container already has a default lock.",
      "asOf": "2026-11-17"
    },
    "F133": {
      "label": "Library name, dependency-injector",
      "display": "Dependency Injector",
      "asOf": "2026-11-20"
    },
    "F134": {
      "label": "Monthly downloads, dependency-injector",
      "display": "11.0M",
      "asOf": "2026-11-20"
    },
    "F135": {
      "label": "License, dependency-injector",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F136": {
      "label": "Package release, dependency-injector",
      "display": "4.49.1",
      "asOf": "2026-11-20"
    },
    "F137": {
      "label": "Package release date, dependency-injector",
      "display": "Jun 2026",
      "asOf": "2026-11-20"
    },
    "F138": {
      "label": "Install, dependency-injector",
      "display": "python -m pip install dependency-injector==4.49.1",
      "asOf": "2026-11-20"
    },
    "F139": {
      "label": "Quickstart, dependency-injector",
      "display": "from dependency_injector import providers\n\nservice = providers.Factory(dict, message='hello')\nprint(service())\n",
      "asOf": "2026-11-20"
    },
    "F140": {
      "label": "Repository stars, dependency-injector",
      "display": "4.9K",
      "asOf": "2026-11-20"
    },
    "F141": {
      "label": "Async factories, dependency-injector",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F142": {
      "label": "Resource cleanup, dependency-injector",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F143": {
      "label": "Composition model, dependency-injector",
      "display": "Explicit provider graph and module wiring",
      "asOf": "2026-11-20"
    },
    "F144": {
      "label": "Project function, dependency-injector",
      "display": "def init_container():\n    container = ServerContainer()\n    container.wire(\n        modules=[\n            emissions,\n            runs,\n            experiments,\n            projects,\n            project_api_tokens,\n            organizations,\n            telemetry,\n            authenticate,\n            auth_service,\n        ]\n    )\n    return container\n",
      "asOf": "2026-11-20"
    },
    "F145": {
      "label": "Project source file, dependency-injector",
      "display": "carbonserver/main.py",
      "asOf": "2026-11-20"
    },
    "F146": {
      "label": "Project full_name, dependency-injector",
      "display": "mlco2/codecarbon",
      "asOf": "2026-11-20"
    },
    "F147": {
      "label": "Project stargazers_count, dependency-injector",
      "display": "1.9K",
      "asOf": "2026-11-20"
    },
    "F148": {
      "label": "Library name, injector",
      "display": "Injector",
      "asOf": "2026-11-20"
    },
    "F149": {
      "label": "Monthly downloads, injector",
      "display": "3.9M",
      "asOf": "2026-11-20"
    },
    "F150": {
      "label": "License, injector",
      "display": "BSD",
      "asOf": "2026-11-20"
    },
    "F151": {
      "label": "Package release, injector",
      "display": "0.24.0",
      "asOf": "2026-11-20"
    },
    "F152": {
      "label": "Package release date, injector",
      "display": "Jan 2026",
      "asOf": "2026-11-20"
    },
    "F153": {
      "label": "Install, injector",
      "display": "python -m pip install injector==0.24.0",
      "asOf": "2026-11-20"
    },
    "F154": {
      "label": "Quickstart, injector",
      "display": "from dataclasses import dataclass\nfrom injector import Injector, inject\nclass Inner:\n    def __init__(self):\n        self.forty_two = 42\n\n@inject\n@dataclass\nclass Outer:\n    inner: Inner\n\ninjector = Injector()\nouter = injector.get(Outer)\nprint(outer.inner.forty_two)  # Prints 42\n",
      "asOf": "2026-11-20"
    },
    "F155": {
      "label": "Repository stars, injector",
      "display": "1.5K",
      "asOf": "2026-11-20"
    },
    "F156": {
      "label": "Async factories, injector",
      "display": "Undocumented",
      "asOf": "2026-11-20"
    },
    "F157": {
      "label": "Resource cleanup, injector",
      "display": "Undocumented",
      "asOf": "2026-11-20"
    },
    "F158": {
      "label": "Composition model, injector",
      "display": "Instance-local typed bindings",
      "asOf": "2026-11-20"
    },
    "F159": {
      "label": "Project function, injector",
      "display": "def create_application_injector() -> Injector:\n    \"\"\"Create a new injector with the default bindings.\"\"\"\n    _injector = Injector(auto_bind=True)\n    _injector.binder.bind(Settings, to=unsafe_typed_settings)\n    return _injector\n",
      "asOf": "2026-11-20"
    },
    "F160": {
      "label": "Project source file, injector",
      "display": "private_gpt/di.py",
      "asOf": "2026-11-20"
    },
    "F161": {
      "label": "Project full_name, injector",
      "display": "zylon-ai/private-gpt",
      "asOf": "2026-11-20"
    },
    "F162": {
      "label": "Project stargazers_count, injector",
      "display": "57.6K",
      "asOf": "2026-11-20"
    },
    "F163": {
      "label": "Library name, svcs",
      "display": "svcs",
      "asOf": "2026-11-20"
    },
    "F164": {
      "label": "Monthly downloads, svcs",
      "display": "3.0M",
      "asOf": "2026-11-20"
    },
    "F165": {
      "label": "License, svcs",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F166": {
      "label": "Package release, svcs",
      "display": "26.2.0",
      "asOf": "2026-11-20"
    },
    "F167": {
      "label": "Package release date, svcs",
      "display": "Aug 2026",
      "asOf": "2026-11-20"
    },
    "F168": {
      "label": "Install, svcs",
      "display": "python -m pip install svcs==26.2.0",
      "asOf": "2026-11-20"
    },
    "F169": {
      "label": "Quickstart, svcs",
      "display": "import svcs\n\nwith svcs.Registry() as registry:\n    registry.register_value(str, 'hello')\n    with svcs.Container(registry) as services:\n        print(services.get(str))\n",
      "asOf": "2026-11-20"
    },
    "F170": {
      "label": "Official description, svcs",
      "display": "Provides a service locator.",
      "asOf": "2026-11-20"
    },
    "F171": {
      "label": "Quickstart source file, svcs",
      "display": "core-concepts.html",
      "asOf": "2026-11-20"
    },
    "F172": {
      "label": "Repository stars, svcs",
      "display": "423",
      "asOf": "2026-11-20"
    },
    "F173": {
      "label": "Async factories, svcs",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F174": {
      "label": "Resource cleanup, svcs",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F175": {
      "label": "Composition model, svcs",
      "display": "Typed registry plus scoped imperative service retrieval",
      "asOf": "2026-11-20"
    },
    "F176": {
      "label": "Service health checks, svcs",
      "display": "Registry callbacks and container health checks",
      "asOf": "2026-11-20"
    },
    "F177": {
      "label": "Project function, svcs",
      "display": "@svcs.fastapi.lifespan\nasync def lifespan(app: FastAPI, registry: svcs.Registry):\n    app.state.lifespan_called = True\n\n    # According to svcs's docs this shouldn't be needed, but something about SubApps is odd, and we need to\n    # record this here\n    app.state.svcs_registry = registry\n\n    registry.register_factory(JWTGenerator, create_jwt_generator)\n\n    # InProcessExecutionAPI stubs out JWTValidator: don't re-register in that case.\n    if JWTValidator not in registry:\n        # Create an app scoped validator, so that we don't have to fetch it every time\n        registry.register_value(JWTValidator, _jwt_validator(), ping=JWTValidator.status)\n\n    yield\n",
      "asOf": "2026-11-20"
    },
    "F178": {
      "label": "Project source file, svcs",
      "display": "airflow-core/src/airflow/api_fastapi/execution_api/app.py",
      "asOf": "2026-11-20"
    },
    "F179": {
      "label": "Project full_name, svcs",
      "display": "apache/airflow",
      "asOf": "2026-11-20"
    },
    "F180": {
      "label": "Project stargazers_count, svcs",
      "display": "47.5K",
      "asOf": "2026-11-20"
    },
    "F181": {
      "label": "Library name, inject",
      "display": "Inject",
      "asOf": "2026-11-20"
    },
    "F182": {
      "label": "Monthly downloads, inject",
      "display": "2.9M",
      "asOf": "2026-11-20"
    },
    "F183": {
      "label": "License, inject",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F184": {
      "label": "Package release, inject",
      "display": "5.5.0",
      "asOf": "2026-11-20"
    },
    "F185": {
      "label": "Package release date, inject",
      "display": "Jul 2026",
      "asOf": "2026-11-20"
    },
    "F186": {
      "label": "Install, inject",
      "display": "python -m pip install inject==5.5.0",
      "asOf": "2026-11-20"
    },
    "F187": {
      "label": "Quickstart, inject",
      "display": "import inject\n\ninject.configure(lambda binder: binder.bind(str, 'hello'))\nprint(inject.instance(str))\n",
      "asOf": "2026-11-20"
    },
    "F188": {
      "label": "Repository stars, inject",
      "display": "778",
      "asOf": "2026-11-20"
    },
    "F189": {
      "label": "Async factories, inject",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F190": {
      "label": "Resource cleanup, inject",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F191": {
      "label": "Composition model, inject",
      "display": "Global injector with explicit configuration",
      "asOf": "2026-11-20"
    },
    "F192": {
      "label": "Async context-manager providers, inject",
      "display": "Supported through async parameter aggregation",
      "asOf": "2026-11-20"
    },
    "F193": {
      "label": "Project function, inject",
      "display": "def configure_inject(self, binder):\n    binder.bind_to_provider(SqliteDatabase, get_db)\n    binder.bind(\"MainWindow\", self.main_window)\n    binder.bind(\"GtkApp\", self.gtk_app)\n    binder.bind(\"MainWindowBuilder\", self.main_window_builder)\n    binder.bind_to_constructor(Gio.Settings, lambda: Gio.Settings(\"com.github.geigi.cozy\"))\n    binder.bind_to_constructor(ApplicationSettings, lambda: ApplicationSettings())\n    binder.bind_to_constructor(Settings, lambda: Settings())\n    binder.bind_to_constructor(\"FilesystemMonitor\", lambda: FilesystemMonitor())\n    binder.bind_to_constructor(OfflineCache, lambda: OfflineCache())\n    binder.bind_to_constructor(Player, lambda: Player())\n    binder.bind_to_constructor(Library, lambda: Library())\n    binder.bind_to_constructor(DatabaseImporter, lambda: DatabaseImporter())\n    binder.bind_to_constructor(LibraryViewModel, lambda: LibraryViewModel())\n    binder.bind_to_constructor(SearchViewModel, lambda: SearchViewModel())\n    binder.bind_to_constructor(Files, lambda: Files())\n    binder.bind_to_constructor(BookDetailViewModel, lambda: BookDetailViewModel())\n    binder.bind_to_constructor(PlaybackControlViewModel, lambda: PlaybackControlViewModel())\n    binder.bind_to_constructor(HeaderbarViewModel, lambda: HeaderbarViewModel())\n    binder.bind_to_constructor(PlaybackSpeedViewModel, lambda: PlaybackSpeedViewModel())\n    binder.bind_to_constructor(SleepTimerViewModel, lambda: SleepTimerViewModel())\n    binder.bind_to_constructor(GstPlayer, lambda: GstPlayer())\n    binder.bind_to_constructor(ToastNotifier, lambda: ToastNotifier())\n    binder.bind_to_constructor(AppViewModel, lambda: AppViewModel())\n    binder.bind_to_constructor(SettingsViewModel, lambda: SettingsViewModel())\n    binder.bind_to_constructor(StoragesViewModel, lambda: StoragesViewModel())\n",
      "asOf": "2026-11-20"
    },
    "F194": {
      "label": "Project source file, inject",
      "display": "cozy/app_controller.py",
      "asOf": "2026-11-20"
    },
    "F195": {
      "label": "Project full_name, inject",
      "display": "geigi/cozy",
      "asOf": "2026-11-20"
    },
    "F196": {
      "label": "Project stargazers_count, inject",
      "display": "1.2K",
      "asOf": "2026-11-20"
    },
    "F197": {
      "label": "Library name, fast-depends",
      "display": "FastDepends",
      "asOf": "2026-11-20"
    },
    "F198": {
      "label": "Monthly downloads, fast-depends",
      "display": "2.3M",
      "asOf": "2026-11-20"
    },
    "F199": {
      "label": "License, fast-depends",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F200": {
      "label": "Package release, fast-depends",
      "display": "3.0.11",
      "asOf": "2026-11-20"
    },
    "F201": {
      "label": "Package release date, fast-depends",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F202": {
      "label": "Install, fast-depends",
      "display": "python -m pip install \"fast-depends[pydantic]==3.0.11\"",
      "asOf": "2026-11-20"
    },
    "F203": {
      "label": "Quickstart, fast-depends",
      "display": "from fast_depends import Depends, inject\n\ndef greeting() -> str:\n    return 'hello'\n\n@inject\ndef show(message: str = Depends(greeting)) -> str:\n    return message\n\nprint(show())\n",
      "asOf": "2026-11-20"
    },
    "F204": {
      "label": "Official description, fast-depends",
      "display": "Runs the FastAPI dependency injection system outside HTTP code, with async and sync support.",
      "asOf": "2026-11-20"
    },
    "F205": {
      "label": "Quickstart source file, fast-depends",
      "display": "fast_depends/use.py",
      "asOf": "2026-11-20"
    },
    "F206": {
      "label": "Repository stars, fast-depends",
      "display": "519",
      "asOf": "2026-11-20"
    },
    "F207": {
      "label": "Async factories, fast-depends",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F208": {
      "label": "Resource cleanup, fast-depends",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F209": {
      "label": "Validation backend, fast-depends",
      "display": "Optional Pydantic or Msgspec serializers",
      "asOf": "2026-11-20"
    },
    "F210": {
      "label": "Project function, fast-depends",
      "display": "def build_model(\n    f: Callable[..., Any],\n    *,\n    sync_to_thread: bool = True,\n    serialize_result: bool = True,\n    use_fastdepends_errors: bool = False,\n    provider: Provider | None = None,\n) -> CallModel:\n    return build_call_model(\n        _to_async(f, sync_to_thread=sync_to_thread),\n        dependency_provider=provider if provider is not None else dependency_provider,\n        serializer_cls=PydanticSerializer(\n            pydantic_config={\"arbitrary_types_allowed\": True},\n            use_fastdepends_errors=use_fastdepends_errors,\n        ),\n        serialize_result=serialize_result,\n    )\n",
      "asOf": "2026-11-20"
    },
    "F211": {
      "label": "Project source file, fast-depends",
      "display": "ag2/utils.py",
      "asOf": "2026-11-20"
    },
    "F212": {
      "label": "Project full_name, fast-depends",
      "display": "ag2ai/ag2",
      "asOf": "2026-11-20"
    },
    "F213": {
      "label": "Project stargazers_count, fast-depends",
      "display": "5.1K",
      "asOf": "2026-11-20"
    },
    "F214": {
      "label": "Library name, dishka",
      "display": "Dishka",
      "asOf": "2026-11-20"
    },
    "F215": {
      "label": "Monthly downloads, dishka",
      "display": "1.5M",
      "asOf": "2026-11-20"
    },
    "F216": {
      "label": "License, dishka",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F217": {
      "label": "Package release, dishka",
      "display": "1.10.1",
      "asOf": "2026-11-20"
    },
    "F218": {
      "label": "Package release date, dishka",
      "display": "Apr 2026",
      "asOf": "2026-11-20"
    },
    "F219": {
      "label": "Install, dishka",
      "display": "python -m pip install dishka==1.10.1",
      "asOf": "2026-11-20"
    },
    "F220": {
      "label": "Quickstart, dishka",
      "display": "from dishka import Provider, Scope, make_container\n\nclass Service:\n    def __init__(self) -> None:\n        self.message = 'hello'\n\nprovider = Provider(scope=Scope.APP)\nprovider.provide(Service)\ncontainer = make_container(provider)\nprint(container.get(Service).message)\ncontainer.close()\n",
      "asOf": "2026-11-20"
    },
    "F221": {
      "label": "Repository stars, dishka",
      "display": "1.3K",
      "asOf": "2026-11-20"
    },
    "F222": {
      "label": "Async factories, dishka",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F223": {
      "label": "Resource cleanup, dishka",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F224": {
      "label": "Lifetime model, dishka",
      "display": "Nested scopes with generator finalization",
      "asOf": "2026-11-20"
    },
    "F225": {
      "label": "Project function, dishka",
      "display": "def build_container(\n    settings: Settings,\n    *,\n    extra_providers: Iterable[Provider] = (),\n    context_overrides: dict[type[Any], Any] | None = None,\n    include_plugins: bool = True,\n    **kwargs: Any,\n) -> AsyncContainer:\n    context: dict[type[Any], Any] = {Settings: settings, TasksBroker: broker, ClientTasksBroker: client_tasks_broker}\n    providers = get_providers()\n    providers.extend(extra_providers)\n    if include_plugins:\n        plugin_classes, plugin_providers = load_plugins(settings)\n        plugin_objects = init_plugins(plugin_classes)\n        plugin_context = build_plugin_di_context(plugin_objects)\n        context[PluginObjects] = plugin_objects\n        context.update(cast(dict[type[Any], Any], plugin_context))\n        providers.extend(plugin_providers)\n    if context_overrides:\n        context.update(context_overrides)\n    return make_async_container(\n        *providers,\n        context=context,\n        **kwargs,\n    )\n",
      "asOf": "2026-11-20"
    },
    "F226": {
      "label": "Project source file, dishka",
      "display": "api/ioc/__init__.py",
      "asOf": "2026-11-20"
    },
    "F227": {
      "label": "Project full_name, dishka",
      "display": "bitcart/bitcart",
      "asOf": "2026-11-20"
    },
    "F228": {
      "label": "Project stargazers_count, dishka",
      "display": "1.0K",
      "asOf": "2026-11-20"
    },
    "F229": {
      "label": "Library name, lagom",
      "display": "Lagom",
      "asOf": "2026-11-20"
    },
    "F230": {
      "label": "Monthly downloads, lagom",
      "display": "447.1K",
      "asOf": "2026-11-20"
    },
    "F231": {
      "label": "License, lagom",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F232": {
      "label": "Package release, lagom",
      "display": "2.7.7",
      "asOf": "2026-11-20"
    },
    "F233": {
      "label": "Package release date, lagom",
      "display": "Jul 2025",
      "asOf": "2026-11-20"
    },
    "F234": {
      "label": "Install, lagom",
      "display": "python -m pip install lagom==2.7.7",
      "asOf": "2026-11-20"
    },
    "F235": {
      "label": "Quickstart, lagom",
      "display": "from lagom import Container\n\nclass Service:\n    def __init__(self) -> None:\n        self.message = 'hello'\n\ncontainer = Container()\nprint(container[Service].message)\n",
      "asOf": "2026-11-20"
    },
    "F236": {
      "label": "Official description, lagom",
      "display": "Provides a dependency injection container that gives just enough help with building dependencies.",
      "asOf": "2026-11-20"
    },
    "F237": {
      "label": "Quickstart source file, lagom",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F238": {
      "label": "Repository stars, lagom",
      "display": "357",
      "asOf": "2026-11-20"
    },
    "F239": {
      "label": "Async factories, lagom",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F240": {
      "label": "Resource cleanup, lagom",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F241": {
      "label": "Composition model, lagom",
      "display": "Type-based autowiring with explicit override factories",
      "asOf": "2026-11-20"
    },
    "F242": {
      "label": "Project function, lagom",
      "display": "def _define_singleton(container: Container, interface: type, implementation: type) -> None:\n    try:\n        container[implementation] = Singleton(implementation)\n\n        if interface != implementation:\n            container[interface] = lambda c: c[implementation]\n    except BaseException:\n        rich.print(\n            rich.text.Text(\n                f\"Error adding {implementation} as implementation for {interface}\",\n                style=\"bold red\",\n            )\n        )\n        raise\n",
      "asOf": "2026-11-20"
    },
    "F243": {
      "label": "Project source file, lagom",
      "display": "src/parlant/bin/server.py",
      "asOf": "2026-11-20"
    },
    "F244": {
      "label": "Project full_name, lagom",
      "display": "emcie-co/parlant",
      "asOf": "2026-11-20"
    },
    "F245": {
      "label": "Project stargazers_count, lagom",
      "display": "18.3K",
      "asOf": "2026-11-20"
    },
    "F246": {
      "label": "Library name, wireup",
      "display": "Wireup",
      "asOf": "2026-11-20"
    },
    "F247": {
      "label": "Monthly downloads, wireup",
      "display": "155.3K",
      "asOf": "2026-11-20"
    },
    "F248": {
      "label": "License, wireup",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F249": {
      "label": "Package release, wireup",
      "display": "2.13.1",
      "asOf": "2026-11-20"
    },
    "F250": {
      "label": "Package release date, wireup",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F251": {
      "label": "Install, wireup",
      "display": "python -m pip install wireup==2.13.1",
      "asOf": "2026-11-20"
    },
    "F252": {
      "label": "Quickstart, wireup",
      "display": "import wireup\n\n@wireup.injectable\nclass Service:\n    def __init__(self) -> None:\n        self.message = 'hello'\n\ncontainer = wireup.create_sync_container(injectables=[Service])\nprint(container.get(Service).message)\n",
      "asOf": "2026-11-20"
    },
    "F253": {
      "label": "Official description, wireup",
      "display": "Provides dependency injection for Python.",
      "asOf": "2026-11-20"
    },
    "F254": {
      "label": "Quickstart source file, wireup",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F255": {
      "label": "Repository stars, wireup",
      "display": "442",
      "asOf": "2026-11-20"
    },
    "F256": {
      "label": "Async factories, wireup",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F257": {
      "label": "Resource cleanup, wireup",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F258": {
      "label": "Lifetime model, wireup",
      "display": "Singleton, scoped, and transient registrations",
      "asOf": "2026-11-20"
    },
    "F259": {
      "label": "Composition model, wireup",
      "display": "Type-driven graph validation at startup",
      "asOf": "2026-11-20"
    }
  },
  "dataCheckedAt": "2026-11-20",
  "agent": {
    "exaCall": {
      "endpoint": "/search",
      "body": {
        "query": "Best Python dependency injection libraries dependency injector Injector inject dishka code examples",
        "numResults": 5
      },
      "docsUrl": "https://exa.ai/docs/reference/search"
    },
    "calls": []
  }
}
