Environments

Use Pydantic Settings(opens in new tab) to define project configuration as typed, validated Python. Extend Environments with the values your solution needs; they are loaded from .env.sample, .env, or process environment variables.

Example

python
from pydantic import Field
from longlink import Environments
​
​
class Env(Environments):
"""Project-specific environment model."""
​
REQUIRED: str = Field(description="Required value")
OPTIONAL: str = Field(default="optional", description="Optional value")
​
​
env = Env()
print(env.REQUIRED)