Skip to content

Conf as pydantic #474

Open
Open
@jneo8

Description

@jneo8

Hi,

I just wonder if there any possible transform configuration as pydantic.BaseSettings type?

There are some frameworks are dependency on pydantic settings.

This is weird to import pydantic to DI's config then to provide it as pydantic again

Or can I use like

from dependency_injector import containers
from pydantic import BaseSettings

class Settings(BaseSettings):
    ...


class Contrainer(containers.DeclarativeContainer):
    settings = providers.Singleton(Settings)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions