2# +==== BEGIN CatFeeder =================+
5# ...............)..(.')
7# ...............\(__)|
8# Inspired by Joan Stark
9# source https://www.asciiart.eu/
13# FILE: bucket_constants.py
14# CREATION DATE: 18-11-2025
15# LAST Modified: 14:42:10 19-12-2025
17# This is the backend server in charge of making the actual website work.
19# COPYRIGHT: (c) Cat Feeder
20# PURPOSE: File in charge of containing the constants required for the bucket wrapper.
22# +==== END CatFeeder =================+
26from typing
import Optional, Dict
29from display_tty
import Disp, initialise_logger
30IDISP: Disp = initialise_logger(
"Bucket Constants",
False)
33dotenv.load_dotenv(
".env")
34_DOTENV = dict(dotenv.dotenv_values())
35_OS_ENV = dict(os.environ)
43 Get the content of an environement variable.
46 variable_name (str): _description_
47 required (bool): If False, return empty string if variable not found. Defaults to True.
50 str: _description_: the value of that variable, otherwise an exception is raised.
52 if environement
is None:
54 "No environement file loaded."
56 data = environement.get(variable_name,
None)
61 f
"Variable {variable_name} not found in the environement"
67BUCKET_RESSOURCE_TYPE: str =
"s3"
71 ENV,
"BUCKET_SIGNATURE_VERSION", required=
False)
or "s3v4"
75 ENV,
"BUCKET_PORT", required=
False)
str _get_environement_variable(Dict[str, Optional[str]] environement, str variable_name, bool required=True)