fastapi_tools.params.env_type
¶
Deployment environment type.
Classes:
-
EnvLocationType–Deployment environment location type.
-
EnvStageType–Deployment environment stage type.
-
EnvType–Deployment environment type.
-
UnknownEnvLocationError–Raised when an unknown or unsupported environment location is encountered.
-
UnknownEnvStageError–Raised when an unknown or unsupported environment stage is encountered.
EnvLocationType
¶
Bases: Enum
Deployment environment location type.
Methods:
-
from_env_var–Get the environment from the environment variable
ENV_LOCATION_TYPE.
from_env_var
classmethod
¶
Get the environment from the environment variable ENV_LOCATION_TYPE.
Parameters:
-
default_env(str, default:'local') –The default environment. Defaults to "local".
Returns:
-
EnvLocationType(EnvLocationType) –The environment type.
Source code in src/fastapi_tools/params/env_type.py
EnvStageType
¶
Bases: Enum
Deployment environment stage type.
Methods:
-
from_env_var–Get the environment from the environment variable
ENV_STAGE_TYPE.
from_env_var
classmethod
¶
Get the environment from the environment variable ENV_STAGE_TYPE.
Parameters:
-
default_env(str, default:'dev') –The default environment. Defaults to "dev".
Returns:
-
EnvStageType(EnvStageType) –The environment type.
Source code in src/fastapi_tools/params/env_type.py
EnvType
dataclass
¶
Deployment environment type.
Methods:
-
__str__–Return the string representation of the environment.
-
from_env_var–Initialize the environment from environment variables.
UnknownEnvLocationError
¶
Bases: Exception
Raised when an unknown or unsupported environment location is encountered.
Parameters:
-
location(EnvLocationType) –the environment location that caused the error
Initialize with the invalid location.
Parameters:
-
location(EnvLocationType) –The unknown environment location
Source code in src/fastapi_tools/params/env_type.py
UnknownEnvStageError
¶
Bases: Exception
Raised when an unknown or unsupported environment stage is encountered.
Parameters:
-
stage(EnvStageType) –the environment stage that caused the error
Initialize with the invalid stage.
Parameters:
-
stage(EnvStageType) –The unknown environment stage