Metadata-Version: 2.5
Name: edd-kernel-factory
Version: 0.2.0a2
Summary: Dynamic provider factory for EDD Kernel.
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: edd-kernel-contracts==0.2.0a2
Requires-Dist: edd-kernel-core==0.2.0a2
Provides-Extra: all
Requires-Dist: edd-kernel-provider-aws-sns-sqs==0.2.0a2; extra == 'all'
Requires-Dist: edd-kernel-provider-aws-sqs==0.2.0a2; extra == 'all'
Requires-Dist: edd-kernel-provider-gcp-pub-sub==0.2.0a2; extra == 'all'
Requires-Dist: edd-kernel-provider-in-memory==0.2.0a2; extra == 'all'
Requires-Dist: edd-kernel-provider-rabbitmq==0.2.0a2; extra == 'all'
Provides-Extra: aws-sns-sqs
Requires-Dist: edd-kernel-provider-aws-sns-sqs==0.2.0a2; extra == 'aws-sns-sqs'
Provides-Extra: aws-sqs
Requires-Dist: edd-kernel-provider-aws-sqs==0.2.0a2; extra == 'aws-sqs'
Provides-Extra: gcp-pub-sub
Requires-Dist: edd-kernel-provider-gcp-pub-sub==0.2.0a2; extra == 'gcp-pub-sub'
Provides-Extra: in-memory
Requires-Dist: edd-kernel-provider-in-memory==0.2.0a2; extra == 'in-memory'
Provides-Extra: rabbitmq
Requires-Dist: edd-kernel-provider-rabbitmq==0.2.0a2; extra == 'rabbitmq'
Description-Content-Type: text/markdown

# edd-kernel-factory

Dynamic provider factory for EDD Kernel.

This package creates an EDD client from configuration and loads provider
packages dynamically. It depends on `edd-kernel-contracts`, but it does not
force every provider package to be installed.

## Install

This is the package an application imports from. Install it with at least one provider:

```bash
uv add edd-kernel-factory edd-kernel-provider-in-memory
```

It re-exports the whole of `edd_kernel.contracts` — the types, the enums, the error
classes and the provider registry — so the application does not install the contract
separately.

## Usage

```python
from edd_kernel.factory import CreateEddClientConfig, EddProviderName, create_edd_client

client = create_edd_client(
    CreateEddClientConfig(
        provider_name=EddProviderName.IN_MEMORY,
        create_if_not_exists=True,
    )
)
```

Provider-specific options are passed through `options`:

```python
client = create_edd_client(
    CreateEddClientConfig(
        provider_name=EddProviderName.AWS_SQS,
        create_if_not_exists=True,
        options={"region": "us-east-1"},
    )
)
```

## Supported Provider Names

| Name | Package |
| --- | --- |
| `in-memory` | `edd-kernel-provider-in-memory` |
| `aws-sqs` | `edd-kernel-provider-aws-sqs` |
| `rabbitmq` | `edd-kernel-provider-rabbitmq` |
| `gcp-pub-sub` | `edd-kernel-provider-gcp-pub-sub` |

The same options are exported as `EddProviderName`. The class-aware registry is
exported as `EDD_PROVIDER_TARGET_BY_NAME`; `EDD_PROVIDER_PACKAGE_BY_NAME` is a
derived compatibility view.

## Custom Provider Classes

`provider_class` is a class constructor, never an existing client instance. A
custom name is accepted when a class is supplied:

```python
client = create_edd_client(
    CreateEddClientConfig(
        provider_name="company-provider",
        provider_class=CompanyEddClient,
        options=CompanyProviderOptions(),
    )
)
```

The class receives shared options first and provider-specific options second.
If it declares `provider_name`, that identity must match the configured name.
The `EddClientClass` protocol describes this constructor contract.

## Shared Options

`CreateEddClientConfig` mirrors the shared `EddClientOptions` fields:

- `serialization`
- `auto_idempotency_key`
- `create_if_not_exists`
- `auto_ack`
- `unhandled_error_action`
- `concurrency`
- `logger`
- `debug`

`options` is reserved for provider-specific configuration.

## Package Boundary

The factory imports a built-in provider module dynamically and instantiates its
public concrete class. If the package or declared class is unavailable,
`create_edd_client` raises a clear runtime error.
