THE ORIONIS API
Build with clarity.
Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.
Define the contract for env implementations.
| Class Method | all |
Retrieve all environment variables as a dictionary. |
| Class Method | get |
Get the value of an environment variable by key. |
| Class Method | reload |
Reload environment variables from the .env file. |
| Class Method | set |
Set or update an environment variable. |
| Class Method | unset |
Remove an environment variable from the .env file. |
| Class Variable | __slots__ |
Declare that this class introduces no additional instance slots. |
orionis.environment.EnvRetrieve all environment variables as a dictionary.
Access the shared DotEnv singleton instance and return all loaded environment variables in dictionary format for inspecting current environment configuration.
| Returns | |
dict[str, typing.Any] | Dictionary containing all environment variables loaded by DotEnv. |
orionis.environment.EnvGet the value of an environment variable by key.
| Parameters | |
key:str | Name of the environment variable to retrieve. |
default:object | None, optional | Value to return if the environment variable is not found. Defaults to None. |
| Returns | |
object | Value of the environment variable if it exists, otherwise the provided default value. |
orionis.environment.EnvReload environment variables from the .env file.
Refresh the shared DotEnv singleton in place: the file is read again into the process environment and the in-memory snapshot is rebuilt, keeping the same instance. Useful when the .env file has been modified externally and the latest values need to be reflected in the application.
| Returns | |
bool | True if the environment variables were reloaded successfully, False if the shared DotEnv instance could not be built because of an OSError or a ValueError. |
| Raises | |
RuntimeError | If the reload itself fails. DotEnv.reload wraps every failure in this type, which is deliberately left to propagate. |
str, value: object, type_hint: str | EnvironmentValueType | None = None, *, only_os: bool = False) -> bool:
(source)
¶
orionis.environment.EnvSet or update an environment variable.
| Parameters | |
key:str | Name of the environment variable to set or update. |
value:object | Value to serialize according to the hint, or its ordinary text form when no hint is supplied. |
typestr | EnvironmentValueType | None, optional | Type hint for the variable. Supported types: 'str', 'int', 'float', 'bool', 'list', 'dict', 'tuple', 'set', 'base64', 'path'. |
onlybool, optional | If True, set the variable only in the OS environment. |
| Returns | |
bool | True after the environment variable is successfully assigned. |
orionis.environment.EnvDeclare that this class introduces no additional instance slots.