# pyioc3
Python Inversion of Control (IoC) Container
# About
pyioc3 is a lightweight and versatile Inversion of Control (IoC) container for
Python. It simplifies the management of dependencies and enables cleaner, more
modular code by promoting the use of Dependency Injection (DI) patterns. With
pyioc3, you can effortlessly wire up your application's components, specify
their lifecycles, and inject dependencies without the hassle of manual
instantiation.
# Key Features
## Multiple APIs
pyioc3 offers multiple configuration interfaces including two manual
configuration APIs and a decorator-based autowiring API. These APIs are
flexible, yet simple to use.
## Fluent Interface
pyioc3 manual APIs support method chaining to minimize boiler-plate code and
intermediate variables.
## Scoped Lifecycles
pyioc3 supports various scopes, including Singleton, Transient, and Requested.
This provides fine-grained control of the lifecycle of your objects.
## Predictability
pyioc3 is an immutable ioc container that guarentees predictability of the
dependency tree.
## Constuctor Based DI
pyioc3 implements constructor based dependency injection making it easy to drop
into existing applications.
## Performance
pyioc3 pre-computes the dependency tree, resulting in fast instantiations to
keep your code fast.
## OOP Principles
pyioc3 is designed to improve the maintainability, testability, and flexibility
of your Python applications.
# Quick Start
Install the package
```bash
pip install --user pyioc3
```
## StaticContainerBuilder API
```python
from pyioc3 import StaticContainerBuilder
container = (
StaticContainerBuilder()
.bind(Duck)
.bind(QuackProvider, Squeak)
.build()
)
duck = container.get(Duck)
duck.quack()
```
## BuilderBase API
```python
from pyioc3.builder import BuilderBase, ProviderBinding
class DuckBuilder(Duck):
def __init__(self):
super().__init__(target_t=Duck)
def with_quack_noise(self, noise: str) -> "DuckBuilder":
self.using_provider(
annotation=QuackProvider,
implementation=DynamicQuackProvider,
on_activate=lambda x: x.set_quack_noise(noise)
)
return self
rubber_duck = (
DuckBuilder()
.with_quack_noise("Squeak")
.build()
)
rubber_duck.quack()
```
## Annotation API
```python
from pyioc3.autowire import bind, AutoWireContainerBuilder
class QuackProvider:
def quack(self):
raise NotImplementedError()
@bind()
class Duck:
def __init__(self, quack: QuackProvider):
self._quack = quack
def quack(self):
self._quack.quack()
@bind(QuackProvider)
class Squeak(QuackProvider):
def quack(self):
print("Squeak")
duck = AutoWireContainerBuilder("my_package").build().get(Duck)
duck.quack()
```
# API Documentation
## Terms
### Provider
A class that provides an implementation of some contract.
### Scope
A rule that defines when a provider is instanciated.
__Transient__: A instanciation rule that causes a new instance of a provider to be created for each dependent reference.
__Requested__: A instanciation rule that causes a new instance of a provider to be created once for each request recieved by the IOC container.
__Singleton__: A instanciation rule that causes a new instance of a provider to be created only once.
Scope Examples:
Consider the given dependency tree.
- Class A depends on Class B and Class C.
- Class B depends on Class C.
- Class C has no dependents.
#### Transient Scope
If class C is bound with transient scope, class A and B will have a unique
instance of C each time they are constructed.
```
a = ioc.get(A)
assert a.c is not a.b.c
a_again = ioc.get(A)
assert a_again.c is not a.c
assert a_again.b.c is not a.b.c
```
#### Requested Scope
If class C is bound with requested scope, class A and B will share an
instance of C each time they are constructed.
```
a = ioc.get(A)
assert a.c is a.b.c
a_again = ioc.get(A)
assert a_again.c is not a.c
assert a_again.b.c is not a.b.c
```
#### Singleton Scope
If class C is bound with singleton scope, class A and B will always recieve the
same instance of C.
```
a = ioc.get(A)
assert a.c is a.b.c
a_again = ioc.get(A)
assert a_again.c is a.c
assert a_again.b.c is a.b.c
```
## References
### pyioc3.interface
#### PROVIDER_T
A Generic TypeVar used to identify the type, concrete or abstract, of an injectable.
#### FACTORY_T
A Generic TypeVar used to identify a factory method.
#### FactoryBinding
Represents a binding for providing instances created by factory functions.
__FactoryBinding.factory:__
Any callable that accepts a `Container` and returns another callable.
__FactoryBinding.annotion:__
Any Type or forward reference used to uniquely identify this injectable.
#### ProviderBinding
Represents a binding for providing instances through dependency injection.
__ProviderBinding.annotation:__
Any Type or forward reference used to uniquely identify this injectable.
__ProviderBinding.implementation:__
Any `Class` or Class-Like reference used as the injectable.
__ProviderBinding.scope:__
Any `ScopeEnum` or str (one of "singleton", "transient", "requested") that
identifies the instantiation strategy.
__ProviderBinding.on_activate:__
Any callable that accepts an instance of `ProviderBinding.implementation` and
returns the same instance.
#### ConstantBinding
__ConstantBinding.annotation:__
Any Type or forward reference used to uniquely identify this injectable.
__ConstantBinding.value:__
Any value used as the injectable.
#### Binding
A type union of FactoryBinding, ProviderBinding, and ConstantBinding.
#### Container
An IOC Container
__Container.get:__
Retrieve an instance of the specified annotation from the container.
Args:
- annotation: The annotation (provider) for which an instance is requested.
Returns:
- PROVIDER_T: An instance of the specified annotation.
Raises:
- MemberNotBoundError: If the requested annotation is not bound in the container.
#### ContainerBuilder
Bind classes, values, functions, and factories to a container.
__ContainerBuilder.bind:__
Bind a class.
Bind any callable type to an annotation. Dependencies will be
injected into this object as needed when created.
Scoping can be set to control reuse.
Arguments:
- annotation: The hint used to inject an instance of implementation
- implementation: (Optional) A callable type who's result will be stored return and stored according to the scope. If implementation is not inlcuded Annotation will be used in it's place.
- scope: (Optional) Identifies how the object should be cached. Options are Transient, Requested, Singleton Default: Transient.
- on_activate: (Optional) A function that will be called with the constructed implementation before it is used as a dep or given as the return in container.get() Default: None.
Scopes:
- Transient scopes and not cached.
- Requested scopes are cached during the current execution of a container.get call.
- Singleton scopes are only instanced once and cached for the lifetime of the container.
Returns:
- An instance of the `ContainerBuilder`
__ContainerBuilder.bind_constant:__
Bind a constant value
This allows you to bind any object to an annotation in a singleton scope.
Arguments:
- annotation: The hint used to inject the constant
- value: Any value. Object, function, type, anything.
Returns:
- An instance of the `ContainerBuilder`
__ContainerBuilder.bind_factory:__
Bind a higher order function
This approach allows you to control the creation of objects and gives you access
to the container. This lets you make runtime decision about how to create an instance.
Arguments:
- annotation: The hint used to inject the factory
- factory: A higher order function that accepts the StackContainer as an arugment.
Returns:
- An instance of the `ContainerBuilder`
__ContainerBuidler.build:__
Compute dependency graph and return the container
This call will roll over all the objects and compute the dependants of each
member. The container itself is also added to the graph and can thus be
injected using it's Type as the annotation.
Returns:
- A `Container`
### pyioc3.scope_enums
#### ScopeEnum
ScopeEnum is an enumeration class representing different dependency scopes.
__ScopeEnum.TRANSIENT:__
Indicates a transient scope where a new instance is created for each request.
__ScopeEnum.REQUESTED:__
Indicates a requested scope where a single instance is created for the duration of a request (a single call to `Container.get`), typically used in web applications.
__ScopeEnum.SINGLETON:__
Indicates a singleton scope where a single instance is created and shared across the entire application.
### pyioc3.static_container_builder
#### StaticContainerBuilder
Implements `ContainerBuilder` to allows the caller to staticly bind classes, values, functions, and factories to a container.
__StaticContainerBuilder.\_\_init\_\_:__
Create a StaticContainerBuilder.
Arguments:
- bindings: (Optional) A list of default binidngs.
Returns:
- A new `ContainerBuilder`
### pyioc3.builder
#### BuilderBase
Base class for building instances with dependency injection.
This class creates a new dependency tree each time build() it is run. This means
that there is no distinction between SINGLETON and REQUESTED scope as the the
underlaying container will only be activated once.
__BuilderBase.\_\_init\_\_:__
Initialize the builder with optional bindings.
The provided target_t will be automatically bound as a default. If included
in bindings, the bindings entry will be used.
Arguments:
- target_t: Type produced by this builder.
- bindings: (Optional) A list of bindings.
__BuilderBase.using_provider:__
Register a provider for dependency injection.
Arguments:
- annotation: The annotion target.
- implementation: The optional implementation class. If not provided, The annotation is used as the implementation.
- scope: The optional scope of the provider. Defaults to Requested.
- on_activate: An optional activation callback.
Returns:
- BuilderBase: The builder instance.
__BuilderBase.using_constant:__
Register a constant for dependency injection.
Arguments:
- annotation: The annotion target.
- value: The constant value.
Returns:
- BuilderBase: The builder instance.
__BuilderBase.using_factory:__
Register a factory function for dependency injection.
Arguments:
- annotation: The annotion target.
- factory: The factory function.
Returns:
- BuilderBase: The builder instance.
__BuilderBase.build:__
Build an instance of the specified target type using the registered dependencies.
Returns:
- TARGET_T: The built instance.
...
### pyioc3.autowire
#### AutoWireContainerBuilder
Implements `ContainerBuilder` to allows the caller to automatically and staticaly bind classes, values, functions, and factories to a container.
This class facilitates the creation of an IoC container by automatically scanning
and binding dependencies from the provided modules.
__AutoWireContainerBuilder.\_\_init\_\_:__
Initialize a new AutoWireContainerBuilder.
Arguments:
- modules: A list of module references (either module names or module objects) to be scanned for dependencies. If a single module reference is provided, it will be treated as a list with a single element.
- excludes: A list of module names to be excluded from scanning. Modules listed here will not be considered for dependency binding. If a single module name is provided, it will be treated as a list with a single element. If not specified or set to an empty list, no modules will be excluded.
__bind:__
Decorator for binding a class for use in dependency injection.
Arguments:
- annotation: The interface or annotation to which the class should be bound as a provider. If not provided, the implementation class itself will be used as the annotation.
- scope: The scope in which the provider instances should be created and managed. It can be one of the values from the `ScopeEnum` enumeration, such as "singleton," "transient," or "requested." If not specified, the default scope, "transient" will be used.
- on_activate: An optional callback function to be executed when instances of the provider class are activated or retrieved from the container. This function can perform additional initialization or configuration on the provider instance.
Returns:
- A decorator function that can be used to annotate a class as a provider for the specified interface.
__bind_factory:__
Decorator for binding a function factory for use in dependency injection.
This decorator allows you to bind a function factory to an interface or annotation,
indicating that the factory should be used to create instances of the specified
type. Function factories are used to construct instances with custom initialization
or configuration.
Arguments:
- annotation: The interface or annotation to which the factory should be bound.
Returns:
- A decorator function that can be used to annotate a function as a factory for the specified interface or annotation.
### pyioc3.errors
#### PyIOC3Error
Base class for all custom PyIOC3 exceptions.
#### CircularDependencyError
Raised if the dependency tree contains cycles.
#### ScopeError
Raised if a string-based scope is not valid.
#### AutoWireError
Raised if the autowire api detects duplicate annotations.
#### MemberNotBoundError
Raised if a member is requested but not bound.
Raw data
{
"_id": null,
"home_page": "https://github.com/en0/pyioc",
"name": "pyioc3",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "OOP IoC Dependency Injection",
"author": "Ian Laird",
"author_email": "irlaird@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/1c/51/cacb711bf840f0125f2236186244c501b852ea4ef249f74349094e92bf70/pyioc3-1.6.3.tar.gz",
"platform": null,
"description": "# pyioc3\n\nPython Inversion of Control (IoC) Container\n\n# About\n\npyioc3 is a lightweight and versatile Inversion of Control (IoC) container for\nPython. It simplifies the management of dependencies and enables cleaner, more\nmodular code by promoting the use of Dependency Injection (DI) patterns. With\npyioc3, you can effortlessly wire up your application's components, specify\ntheir lifecycles, and inject dependencies without the hassle of manual\ninstantiation.\n\n# Key Features\n\n## Multiple APIs\n\npyioc3 offers multiple configuration interfaces including two manual\nconfiguration APIs and a decorator-based autowiring API. These APIs are\nflexible, yet simple to use.\n\n## Fluent Interface\n\npyioc3 manual APIs support method chaining to minimize boiler-plate code and\nintermediate variables.\n\n## Scoped Lifecycles\n\npyioc3 supports various scopes, including Singleton, Transient, and Requested.\nThis provides fine-grained control of the lifecycle of your objects.\n\n## Predictability\n\npyioc3 is an immutable ioc container that guarentees predictability of the\ndependency tree.\n\n## Constuctor Based DI\n\npyioc3 implements constructor based dependency injection making it easy to drop\ninto existing applications.\n\n## Performance\n\npyioc3 pre-computes the dependency tree, resulting in fast instantiations to\nkeep your code fast.\n\n## OOP Principles\n\npyioc3 is designed to improve the maintainability, testability, and flexibility\nof your Python applications.\n\n# Quick Start\n\nInstall the package\n\n```bash\npip install --user pyioc3\n```\n\n## StaticContainerBuilder API\n\n```python\nfrom pyioc3 import StaticContainerBuilder\n\ncontainer = (\n StaticContainerBuilder()\n .bind(Duck)\n .bind(QuackProvider, Squeak)\n .build()\n)\n\nduck = container.get(Duck)\nduck.quack()\n```\n\n## BuilderBase API\n\n```python\nfrom pyioc3.builder import BuilderBase, ProviderBinding\n\nclass DuckBuilder(Duck):\n def __init__(self):\n super().__init__(target_t=Duck)\n\n def with_quack_noise(self, noise: str) -> \"DuckBuilder\":\n self.using_provider(\n annotation=QuackProvider,\n implementation=DynamicQuackProvider,\n on_activate=lambda x: x.set_quack_noise(noise)\n )\n return self\n\nrubber_duck = (\n DuckBuilder()\n .with_quack_noise(\"Squeak\")\n .build()\n)\n\nrubber_duck.quack()\n```\n\n## Annotation API\n\n```python\nfrom pyioc3.autowire import bind, AutoWireContainerBuilder\n\n\nclass QuackProvider:\n def quack(self):\n raise NotImplementedError()\n\n\n@bind()\nclass Duck:\n def __init__(self, quack: QuackProvider):\n self._quack = quack\n\n def quack(self):\n self._quack.quack()\n\n\n@bind(QuackProvider)\nclass Squeak(QuackProvider):\n\n def quack(self):\n print(\"Squeak\")\n\n\nduck = AutoWireContainerBuilder(\"my_package\").build().get(Duck)\nduck.quack()\n```\n\n# API Documentation\n\n## Terms\n\n### Provider\n\nA class that provides an implementation of some contract.\n\n### Scope\n\nA rule that defines when a provider is instanciated.\n\n__Transient__: A instanciation rule that causes a new instance of a provider to be created for each dependent reference.\n__Requested__: A instanciation rule that causes a new instance of a provider to be created once for each request recieved by the IOC container.\n__Singleton__: A instanciation rule that causes a new instance of a provider to be created only once.\n\nScope Examples:\n\nConsider the given dependency tree.\n\n- Class A depends on Class B and Class C.\n- Class B depends on Class C.\n- Class C has no dependents.\n\n#### Transient Scope\n\nIf class C is bound with transient scope, class A and B will have a unique\ninstance of C each time they are constructed.\n\n```\na = ioc.get(A)\nassert a.c is not a.b.c\n\na_again = ioc.get(A)\nassert a_again.c is not a.c\nassert a_again.b.c is not a.b.c\n```\n\n#### Requested Scope\n\nIf class C is bound with requested scope, class A and B will share an\ninstance of C each time they are constructed.\n\n```\na = ioc.get(A)\nassert a.c is a.b.c\n\na_again = ioc.get(A)\nassert a_again.c is not a.c\nassert a_again.b.c is not a.b.c\n```\n\n#### Singleton Scope\n\nIf class C is bound with singleton scope, class A and B will always recieve the\nsame instance of C.\n\n```\na = ioc.get(A)\nassert a.c is a.b.c\n\na_again = ioc.get(A)\nassert a_again.c is a.c\nassert a_again.b.c is a.b.c\n```\n\n## References\n\n### pyioc3.interface\n\n#### PROVIDER_T\n\nA Generic TypeVar used to identify the type, concrete or abstract, of an injectable.\n\n#### FACTORY_T\n\nA Generic TypeVar used to identify a factory method.\n\n#### FactoryBinding\n\nRepresents a binding for providing instances created by factory functions.\n\n__FactoryBinding.factory:__\n\nAny callable that accepts a `Container` and returns another callable.\n\n__FactoryBinding.annotion:__\n\nAny Type or forward reference used to uniquely identify this injectable.\n\n#### ProviderBinding\n\nRepresents a binding for providing instances through dependency injection.\n\n__ProviderBinding.annotation:__\n\nAny Type or forward reference used to uniquely identify this injectable.\n\n__ProviderBinding.implementation:__\n\nAny `Class` or Class-Like reference used as the injectable.\n\n__ProviderBinding.scope:__\n\nAny `ScopeEnum` or str (one of \"singleton\", \"transient\", \"requested\") that\nidentifies the instantiation strategy.\n\n__ProviderBinding.on_activate:__\n\nAny callable that accepts an instance of `ProviderBinding.implementation` and\nreturns the same instance.\n\n#### ConstantBinding\n\n__ConstantBinding.annotation:__\n\nAny Type or forward reference used to uniquely identify this injectable.\n\n__ConstantBinding.value:__\n\nAny value used as the injectable.\n\n#### Binding\n\nA type union of FactoryBinding, ProviderBinding, and ConstantBinding.\n\n#### Container\n\nAn IOC Container\n\n__Container.get:__\n\nRetrieve an instance of the specified annotation from the container.\n\nArgs:\n\n- annotation: The annotation (provider) for which an instance is requested.\n\nReturns:\n\n- PROVIDER_T: An instance of the specified annotation.\n\nRaises:\n- MemberNotBoundError: If the requested annotation is not bound in the container.\n\n#### ContainerBuilder\n\nBind classes, values, functions, and factories to a container.\n\n__ContainerBuilder.bind:__\n\nBind a class.\n\nBind any callable type to an annotation. Dependencies will be\ninjected into this object as needed when created.\n\nScoping can be set to control reuse.\n\nArguments:\n\n- annotation: The hint used to inject an instance of implementation\n- implementation: (Optional) A callable type who's result will be stored return and stored according to the scope. If implementation is not inlcuded Annotation will be used in it's place.\n- scope: (Optional) Identifies how the object should be cached. Options are Transient, Requested, Singleton Default: Transient.\n- on_activate: (Optional) A function that will be called with the constructed implementation before it is used as a dep or given as the return in container.get() Default: None.\n\nScopes:\n\n- Transient scopes and not cached.\n- Requested scopes are cached during the current execution of a container.get call.\n- Singleton scopes are only instanced once and cached for the lifetime of the container.\n\nReturns:\n\n- An instance of the `ContainerBuilder`\n\n__ContainerBuilder.bind_constant:__\n\nBind a constant value\n\nThis allows you to bind any object to an annotation in a singleton scope.\n\nArguments:\n\n- annotation: The hint used to inject the constant\n- value: Any value. Object, function, type, anything.\n\nReturns: \n\n- An instance of the `ContainerBuilder`\n\n__ContainerBuilder.bind_factory:__\n\nBind a higher order function\n\nThis approach allows you to control the creation of objects and gives you access\nto the container. This lets you make runtime decision about how to create an instance.\n\nArguments:\n\n- annotation: The hint used to inject the factory\n- factory: A higher order function that accepts the StackContainer as an arugment.\n\nReturns: \n\n- An instance of the `ContainerBuilder`\n\n__ContainerBuidler.build:__\n\nCompute dependency graph and return the container\n\nThis call will roll over all the objects and compute the dependants of each\nmember. The container itself is also added to the graph and can thus be\ninjected using it's Type as the annotation.\n\nReturns: \n\n- A `Container`\n\n### pyioc3.scope_enums\n\n#### ScopeEnum\n\nScopeEnum is an enumeration class representing different dependency scopes.\n\n__ScopeEnum.TRANSIENT:__\n\nIndicates a transient scope where a new instance is created for each request.\n\n__ScopeEnum.REQUESTED:__\n\nIndicates a requested scope where a single instance is created for the duration of a request (a single call to `Container.get`), typically used in web applications.\n\n__ScopeEnum.SINGLETON:__\n\nIndicates a singleton scope where a single instance is created and shared across the entire application.\n\n### pyioc3.static_container_builder\n\n#### StaticContainerBuilder\n\nImplements `ContainerBuilder` to allows the caller to staticly bind classes, values, functions, and factories to a container.\n\n__StaticContainerBuilder.\\_\\_init\\_\\_:__\n\nCreate a StaticContainerBuilder.\n\nArguments:\n\n- bindings: (Optional) A list of default binidngs.\n\nReturns: \n\n- A new `ContainerBuilder`\n\n### pyioc3.builder\n\n#### BuilderBase\n\nBase class for building instances with dependency injection.\n\nThis class creates a new dependency tree each time build() it is run. This means\nthat there is no distinction between SINGLETON and REQUESTED scope as the the\nunderlaying container will only be activated once.\n\n__BuilderBase.\\_\\_init\\_\\_:__\n\nInitialize the builder with optional bindings.\n\nThe provided target_t will be automatically bound as a default. If included\nin bindings, the bindings entry will be used.\n\nArguments:\n\n- target_t: Type produced by this builder.\n- bindings: (Optional) A list of bindings.\n\n__BuilderBase.using_provider:__\n\nRegister a provider for dependency injection.\n\nArguments:\n\n- annotation: The annotion target.\n- implementation: The optional implementation class. If not provided, The annotation is used as the implementation.\n- scope: The optional scope of the provider. Defaults to Requested.\n- on_activate: An optional activation callback.\n\nReturns:\n\n- BuilderBase: The builder instance.\n\n__BuilderBase.using_constant:__\n\nRegister a constant for dependency injection.\n\nArguments:\n\n- annotation: The annotion target.\n- value: The constant value.\n\nReturns:\n\n- BuilderBase: The builder instance.\n\n__BuilderBase.using_factory:__\n\nRegister a factory function for dependency injection.\n\nArguments:\n\n- annotation: The annotion target.\n- factory: The factory function.\n\nReturns:\n\n- BuilderBase: The builder instance.\n\n__BuilderBase.build:__\n\nBuild an instance of the specified target type using the registered dependencies.\n\nReturns:\n\n- TARGET_T: The built instance.\n\n...\n\n\n### pyioc3.autowire\n\n#### AutoWireContainerBuilder\n\nImplements `ContainerBuilder` to allows the caller to automatically and staticaly bind classes, values, functions, and factories to a container.\n\nThis class facilitates the creation of an IoC container by automatically scanning\nand binding dependencies from the provided modules.\n\n__AutoWireContainerBuilder.\\_\\_init\\_\\_:__\n\nInitialize a new AutoWireContainerBuilder.\n\nArguments:\n\n- modules: A list of module references (either module names or module objects) to be scanned for dependencies. If a single module reference is provided, it will be treated as a list with a single element.\n- excludes: A list of module names to be excluded from scanning. Modules listed here will not be considered for dependency binding. If a single module name is provided, it will be treated as a list with a single element. If not specified or set to an empty list, no modules will be excluded.\n\n\n__bind:__\n\nDecorator for binding a class for use in dependency injection.\n\nArguments:\n\n- annotation: The interface or annotation to which the class should be bound as a provider. If not provided, the implementation class itself will be used as the annotation.\n- scope: The scope in which the provider instances should be created and managed. It can be one of the values from the `ScopeEnum` enumeration, such as \"singleton,\" \"transient,\" or \"requested.\" If not specified, the default scope, \"transient\" will be used.\n- on_activate: An optional callback function to be executed when instances of the provider class are activated or retrieved from the container. This function can perform additional initialization or configuration on the provider instance.\n\nReturns:\n\n- A decorator function that can be used to annotate a class as a provider for the specified interface.\n\n__bind_factory:__\n\nDecorator for binding a function factory for use in dependency injection.\n\nThis decorator allows you to bind a function factory to an interface or annotation,\nindicating that the factory should be used to create instances of the specified\ntype. Function factories are used to construct instances with custom initialization\nor configuration.\n\nArguments:\n\n- annotation: The interface or annotation to which the factory should be bound.\n\nReturns:\n\n- A decorator function that can be used to annotate a function as a factory for the specified interface or annotation.\n\n### pyioc3.errors\n\n#### PyIOC3Error\n\nBase class for all custom PyIOC3 exceptions.\n\n#### CircularDependencyError\n\nRaised if the dependency tree contains cycles.\n\n#### ScopeError\n\nRaised if a string-based scope is not valid.\n\n#### AutoWireError\n\nRaised if the autowire api detects duplicate annotations.\n\n#### MemberNotBoundError\n\nRaised if a member is requested but not bound.\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Python IOC Container",
"version": "1.6.3",
"project_urls": {
"Homepage": "https://github.com/en0/pyioc"
},
"split_keywords": [
"oop",
"ioc",
"dependency",
"injection"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "fdd198e8b2b7e1429a86a4d9f5da83bad8182c5612a94c9b9380dae741fc53ed",
"md5": "d7a5826e2fb4e7f00a9c7ee504d717c8",
"sha256": "2d07a8231c6e6fcbcad622c061c26f1e946c215942287bca2aaff6e98e472893"
},
"downloads": -1,
"filename": "pyioc3-1.6.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d7a5826e2fb4e7f00a9c7ee504d717c8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 23330,
"upload_time": "2025-08-15T22:09:09",
"upload_time_iso_8601": "2025-08-15T22:09:09.240679Z",
"url": "https://files.pythonhosted.org/packages/fd/d1/98e8b2b7e1429a86a4d9f5da83bad8182c5612a94c9b9380dae741fc53ed/pyioc3-1.6.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "1c51cacb711bf840f0125f2236186244c501b852ea4ef249f74349094e92bf70",
"md5": "88a105123eab0348da83744e1d65945a",
"sha256": "b1419437f030ac7d5a655484d3b0d6ba8eecfd7542fb127c89c02ed15a954152"
},
"downloads": -1,
"filename": "pyioc3-1.6.3.tar.gz",
"has_sig": false,
"md5_digest": "88a105123eab0348da83744e1d65945a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 24617,
"upload_time": "2025-08-15T22:09:10",
"upload_time_iso_8601": "2025-08-15T22:09:10.772349Z",
"url": "https://files.pythonhosted.org/packages/1c/51/cacb711bf840f0125f2236186244c501b852ea4ef249f74349094e92bf70/pyioc3-1.6.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-15 22:09:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "en0",
"github_project": "pyioc",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pyioc3"
}