{"id":46810,"library":"wired","title":"wired","description":"An inversion-of-control (IoC) container for Python that supports dependency injection via service registration and factory functions. Current version 0.4, targeting Python >=3.8. Release cadence is low; it is a stable but rarely updated library.","status":"active","version":"0.4","language":"python","source_language":"en","source_url":"https://github.com/mmerickel/wired","tags":["dependency-injection","ioc","inversion-of-control"],"install":[{"cmd":"pip install wired","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Contains the IoC container, service registry, and decorators.","package":"wired","optional":false}],"imports":[{"note":"The primary class for creating a container.","wrong":"","symbol":"ServiceRegistry","correct":"from wired import ServiceRegistry"},{"note":"injectable is a module, not a subpackage; the decorator is imported as 'from wired import injectable'.","wrong":"from wired.injectable import injectable","symbol":"injectable","correct":"from wired import injectable"},{"note":"The dataclass decorator is in the 'wired' package directly.","wrong":"from wired.dataclasses import dataclass","symbol":"dataclass","correct":"from wired import dataclass"}],"quickstart":{"code":"from wired import ServiceRegistry, injectable\n\n# Define a service\n@injectable()\nclass Greeter:\n    def __init__(self, greeting: str = \"Hello\"):\n        self.greeting = greeting\n\n    def greet(self, name: str) -> str:\n        return f\"{self.greeting}, {name}!\"\n\n# Set up registry\nregistry = ServiceRegistry()\nregistry.register(Greeter)\n\n# Get a container and use\ncontainer = registry.create_container()\ngreeter = container.get(Greeter)\nprint(greeter.greet(\"World\"))","lang":"python","description":"Create a service registry, register an injectable class, and retrieve it from a container."},"warnings":[{"fix":"Add @injectable() decorator to any class that will be injected.","message":"Services registered without @injectable() will not be recognized; the decorator must be applied.","severity":"gotcha","affected_versions":"0.x"},{"fix":"Use 'from wired import injectable' and apply as a decorator.","message":"The 'wired.injectable' submodule is not a public API; importing from it may break in future versions.","severity":"deprecated","affected_versions":"0.3+"},{"fix":"Add type hints to all __init__ parameters.","message":"Constructor parameters for injectable classes must be type-annotated; otherwise, wired cannot resolve dependencies.","severity":"gotcha","affected_versions":"0.x"}],"env_vars":null,"search_vec":"'0.4':23 '3.8':26 'cadenc':28 'contain':8 'control':6,46 'current':21 'depend':13,40 'dependency-inject':39 'factori':19 'function':20 'inject':14,41 'invers':4,44 'inversion-of-control':3,43 'ioc':7,42 'librari':38 'low':30 'python':10,25 'rare':36 'registr':17 'releas':27 'servic':16 'stabl':34 'support':12 'target':24 'updat':37 'version':22 'via':15 'wire':1","created_at":"2026-06-07T13:01:44.226224+00:00","updated_at":"2026-06-07T13:01:44.226224+00:00","problems":[{"fix":"Call registry.register(YourClass) before creating the container.","cause":"The service class was not registered in the ServiceRegistry.","error":"TypeError: can't inject type 'xyz'; no factory registered"},{"fix":"Apply @injectable() to the class definition.","cause":"Class missing @injectable() decorator.","error":"wired.exceptions.CannotInject: Cannot inject <class '__main__.MyService'> - no @injectable decorator"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/mmerickel/wired","github":"https://github.com/mmerickel/wired","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}