Registry / devops / decouple-types

decouple-types

JSON →
library1.0.2pypypiunverified

Provides typed versions of the popular python-decouple configuration library for cleaner and safer environment variable handling. Current version is 1.0.2, with a slow release cadence. It adds type hints and Pydantic-style validation to decouple settings.

pip install decouple-types
INSTALL
IMPORT
SIG · DECOUPLE-TYPES
D
decouple-types
devopspythonv1.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TypedConfig
from decouple_stubs import TypedConfig
from decouple_types import TypedConfig

Define typed settings with Pydantic fields, automatically populated from environment variables via decouple.

from decouple_types import TypedConfig from pydantic import Field from typing import Optional import os class Settings(TypedConfig): DATABASE_URL: str = Field(os.environ.get('DATABASE_URL', 'sqlite:///default.db')) DEBUG: bool = Field(default=False) SECRET_KEY: Optional[str] = Field(None) settings = Settings() print(settings.DATABASE_URL) print(settings.DEBUG)
Debug
Known issues
gotchadecouple-types does not automatically read .env files. You must call decouple's config or use python-decouple's repository explicitly.
fix
Either call `from decouple import config` and set variables, or use a decouple repository like `RepositoryEnv('.env')`.
affects: all
gotchaField default values are used as fallbacks, but if the environment variable is set to empty string, it will override the default with empty string.
fix
Use `cast` or pydantic validators to handle empty strings appropriately.
affects: all
Upgrade
Version history
1.0.2latest on PyPI · released Mar 7, 2025
Audit
Dependencies
python-decouplerequiredRuntime dependency for configuration parsing
pydanticoptionalOptional but recommended for typed settings validation
Agent activity
13 hits · last 30 days
node
12
Resources
decouple-types — pip install decouple-types · libregistry