{"id":21460,"library":"in-n-out","title":"in-n-out","description":"A plugable dependency injection and result processing library for Python. Current version 0.2.1, released June 2025. Active development with monthly releases.","status":"active","version":"0.2.1","language":"python","source_language":"en","source_url":"https://github.com/tiangolo/in-n-out","tags":["dependency injection","result processing","decorators","python"],"install":[{"cmd":"pip install in-n-out","lang":"bash","label":"Simple installation"}],"dependencies":[],"imports":[{"note":"","wrong":"","symbol":"Injector","correct":"from in_n_out import Injector"},{"note":"","wrong":"","symbol":"Processor","correct":"from in_n_out import Processor"},{"note":"","wrong":"","symbol":"intake","correct":"from in_n_out import intake"}],"quickstart":{"code":"from in_n_out import Injector, Processor, intake\n\nclass MyService:\n    def greet(self, name: str) -> str:\n        return f\"Hello, {name}!\"\n\ninjector = Injector()\nprocessor = Processor()\n\n@injector.register\n@processor.register\ndef my_function(name: str) -> str:\n    service = MyService()\n    return service.greet(name)\n\nresult = processor.process(my_function, name=\"World\")\nprint(result)","lang":"python","description":"Simple dependency injection and result processing example."},"warnings":[{"fix":"Decorate the function twice, once per instance.","message":"The `register` decorator with both Injector and Processor on the same function is deprecated; use `@injector.register` and `@processor.register` separately.","severity":"deprecated","affected_versions":"0.2.0+"},{"fix":"Use `await processor.process(...)` for async functions.","message":"Processor returns a coroutine object if the function is async; you must await it.","severity":"gotcha","affected_versions":"all"},{"fix":"Upgrade to 0.2.x and use `Injector.register`.","message":"Before v0.2.0, the `inject` decorator existed; it was removed and replaced with `Injector.register`.","severity":"breaking","affected_versions":"<=0.1.x"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run `pip install in-n-out` and ensure you are using Python >=3.8.","cause":"Library not installed or Python environment mismatch.","error":"ModuleNotFoundError: No module named 'in_n_out'"},{"fix":"Register a result processor for the return type using `@processor.register`.","cause":"Return value from `processor.process()` is None because no registered processor handles the function's return type.","error":"TypeError: 'NoneType' object is not callable"},{"fix":"Use `from in_n_out import Injector` or `import in_n_out; injector = in_n_out.Injector()`.","cause":"Incorrect import path; the class is exported from the top-level package.","error":"AttributeError: module 'in_n_out' has no attribute 'Injector'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}