maleo-foundation 0.1.13__tar.gz → 0.1.15__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/PKG-INFO +1 -1
  2. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/managers/client/base.py +1 -0
  3. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/managers/client/google/secret.py +3 -2
  4. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/managers/client/google/storage.py +3 -2
  5. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/managers/client/maleo.py +9 -1
  6. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/managers/db.py +5 -5
  7. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/managers/service.py +2 -4
  8. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation.egg-info/PKG-INFO +1 -1
  9. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/pyproject.toml +1 -1
  10. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/README.md +0 -0
  11. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/__init__.py +0 -0
  12. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/clients/__init__.py +0 -0
  13. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/clients/general/__init__.py +0 -0
  14. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/clients/general/http.py +0 -0
  15. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/clients/google/__init__.py +0 -0
  16. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/clients/google/base.py +0 -0
  17. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/clients/google/cloud/__init__.py +0 -0
  18. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/clients/google/cloud/base.py +0 -0
  19. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/clients/google/cloud/logging.py +0 -0
  20. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/clients/google/cloud/secret.py +0 -0
  21. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/clients/google/cloud/storage.py +0 -0
  22. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/clients/google/secret.py +0 -0
  23. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/clients/google/storage.py +0 -0
  24. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/clients/utils/__init__.py +0 -0
  25. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/clients/utils/logger.py +0 -0
  26. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/constants.py +0 -0
  27. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/db/__init__.py +0 -0
  28. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/db/engine.py +0 -0
  29. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/db/manager.py +0 -0
  30. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/db/session.py +0 -0
  31. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/db/table.py +0 -0
  32. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/enums.py +0 -0
  33. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/expanded_types/__init__.py +0 -0
  34. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/expanded_types/client.py +0 -0
  35. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/expanded_types/general.py +0 -0
  36. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/expanded_types/query.py +0 -0
  37. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/expanded_types/service.py +0 -0
  38. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/expanded_types/token.py +0 -0
  39. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/extended_types.py +0 -0
  40. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/managers/__init__.py +0 -0
  41. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/managers/client/__init__.py +0 -0
  42. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/managers/client/google/__init__.py +0 -0
  43. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/managers/client/google/base.py +0 -0
  44. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/managers/client/http.py +0 -0
  45. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/middlewares/__init__.py +0 -0
  46. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/middlewares/base.py +0 -0
  47. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/middlewares/cors.py +0 -0
  48. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/__init__.py +0 -0
  49. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/responses.py +0 -0
  50. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/schemas/__init__.py +0 -0
  51. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/schemas/general.py +0 -0
  52. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/schemas/parameter.py +0 -0
  53. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/schemas/result.py +0 -0
  54. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/schemas/token.py +0 -0
  55. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/transfers/__init__.py +0 -0
  56. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/transfers/general/__init__.py +0 -0
  57. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/transfers/general/token.py +0 -0
  58. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/transfers/parameters/__init__.py +0 -0
  59. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/transfers/parameters/client.py +0 -0
  60. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/transfers/parameters/general.py +0 -0
  61. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/transfers/parameters/service.py +0 -0
  62. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/transfers/parameters/token.py +0 -0
  63. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/transfers/results/__init__.py +0 -0
  64. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/transfers/results/client/__init__.py +0 -0
  65. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/transfers/results/client/controllers/__init__.py +0 -0
  66. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/transfers/results/client/controllers/http.py +0 -0
  67. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/transfers/results/client/service.py +0 -0
  68. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/transfers/results/service/__init__.py +0 -0
  69. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/transfers/results/service/controllers/__init__.py +0 -0
  70. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/transfers/results/service/controllers/rest.py +0 -0
  71. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/transfers/results/service/general.py +0 -0
  72. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/transfers/results/service/query.py +0 -0
  73. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/models/transfers/results/token.py +0 -0
  74. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/services/__init__.py +0 -0
  75. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/services/token.py +0 -0
  76. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/types.py +0 -0
  77. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/utils/__init__.py +0 -0
  78. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/utils/controller.py +0 -0
  79. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/utils/exceptions.py +0 -0
  80. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/utils/formatter/__init__.py +0 -0
  81. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/utils/formatter/case.py +0 -0
  82. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/utils/keyloader.py +0 -0
  83. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/utils/logger.py +0 -0
  84. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/utils/logging.py +0 -0
  85. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation/utils/query.py +0 -0
  86. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation.egg-info/SOURCES.txt +0 -0
  87. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation.egg-info/dependency_links.txt +0 -0
  88. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation.egg-info/requires.txt +0 -0
  89. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/maleo_foundation.egg-info/top_level.txt +0 -0
  90. {maleo_foundation-0.1.13 → maleo_foundation-0.1.15}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.1.13
3
+ Version: 0.1.15
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -8,6 +8,7 @@ class ClientManager:
8
8
  self._logs_dir = logs_dir
9
9
  self._google_cloud_logging = google_cloud_logging
10
10
  self._initialize_logger()
11
+ self._logger.info("Initializing client manager")
11
12
 
12
13
  def _initialize_logger(self) -> None:
13
14
  self._logger = ClientLogger(logs_dir=self._logs_dir, client_key=self._key, google_cloud_logging=self._google_cloud_logging)
@@ -16,6 +16,7 @@ class GoogleSecretManager(GoogleClientManager):
16
16
  credentials_path=credentials_path
17
17
  )
18
18
  self._client = secretmanager.SecretManagerServiceClient(credentials=self._credentials)
19
+ self._logger.info("Client manager initialized successfully")
19
20
 
20
21
  @property
21
22
  def client(self) -> secretmanager.SecretManagerServiceClient:
@@ -23,9 +24,9 @@ class GoogleSecretManager(GoogleClientManager):
23
24
 
24
25
  def dispose(self) -> None:
25
26
  if self._client is not None:
26
- self._logger.info("Disposing Google Secret Manager (GSM) client manager")
27
+ self._logger.info("Disposing client manager")
27
28
  self._client = None
28
- self._logger.info("Google Secret Manager (GCS) client manager disposed successfully")
29
+ self._logger.info("Client manager disposed successfully")
29
30
 
30
31
  @retry.Retry(predicate=retry.if_exception_type(Exception), timeout=5)
31
32
  def get(self, name:str, version:str = "latest") -> Optional[str]:
@@ -24,6 +24,7 @@ class GoogleCloudStorage(GoogleClientManager):
24
24
  if self._bucket is None:
25
25
  self._client.close()
26
26
  raise ValueError(f"Bucket '{self._bucket_name}' does not exist.")
27
+ self._logger.info("Client manager initialized successfully")
27
28
 
28
29
  @property
29
30
  def bucket_name(self) -> str:
@@ -35,10 +36,10 @@ class GoogleCloudStorage(GoogleClientManager):
35
36
 
36
37
  def dispose(self) -> None:
37
38
  if self._client is not None:
38
- self._logger.info("Disposing Google Cloud Storage (GCS) client manager")
39
+ self._logger.info("Disposing client manager")
39
40
  self._client.close()
40
41
  self._client = None
41
- self._logger.info("Google Cloud Storage (GCS) client manager disposed successfully")
42
+ self._logger.info("Client manager disposed successfully")
42
43
 
43
44
  def generate_signed_url(self, location:str) -> str:
44
45
  """
@@ -42,6 +42,9 @@ class ClientHTTPControllerManager:
42
42
  def url(self) -> URL:
43
43
  return self._url
44
44
 
45
+ async def dispose(self) -> None:
46
+ await self._client.aclose()
47
+
45
48
  class ClientControllerManagers(BaseModel):
46
49
  http:ClientHTTPControllerManager = Field(..., description="HTTP Client Controller")
47
50
 
@@ -108,4 +111,9 @@ class MaleoClientManager(ClientManager):
108
111
 
109
112
  @property
110
113
  def services(self) -> ClientServices:
111
- return self._services
114
+ return self._services
115
+
116
+ async def dispose(self) -> None:
117
+ self._logger.info("Disposing client manager")
118
+ await self._controller_managers.http.dispose()
119
+ self._logger.info("Client manager disposed successfully")
@@ -17,9 +17,9 @@ class MetadataManager:
17
17
  class SessionManager:
18
18
  def __init__(self, logger:BaseLogger, engine:Engine):
19
19
  self._logger = logger
20
- self._logger.info("Initializing SessionMaker.")
20
+ self._logger.info("Initializing SessionMaker")
21
21
  self._sessionmaker:sessionmaker[Session] = sessionmaker(bind=engine, expire_on_commit=False)
22
- self._logger.info("SessionMaker initialized successfully.")
22
+ self._logger.info("SessionMaker initialized successfully")
23
23
 
24
24
  def _session_handler(self) -> Generator[Session, None, None]:
25
25
  """Reusable function for managing database sessions."""
@@ -55,7 +55,7 @@ class SessionManager:
55
55
  self._sessionmaker.close_all()
56
56
  self._sessionmaker = None
57
57
 
58
- self._logger.info("SessionManager disposed successfully.")
58
+ self._logger.info("SessionManager disposed successfully")
59
59
  self._logger = None
60
60
 
61
61
  class DatabaseManager:
@@ -74,7 +74,7 @@ class DatabaseManager:
74
74
  raise ValueError("DB_URL environment variable must be set if url is not provided")
75
75
  self._logger.info("Creating SQlAlchemy engine")
76
76
  self._engine = create_engine(url=url, echo=False, pool_pre_ping=True, pool_recycle=3600)
77
- self._logger.info("SQlAlchemy engine created")
77
+ self._logger.info("SQlAlchemy engine created successfully")
78
78
 
79
79
  #* Creating all table from metadata
80
80
  self._logger.info("Creating all tables defined in metadata")
@@ -84,7 +84,7 @@ class DatabaseManager:
84
84
  #* Initializing session manager
85
85
  self._logger.info("Initializing session manager")
86
86
  self._session = SessionManager(logger=self._logger, engine=self._engine) #* Define session
87
- self._logger.info("Session manager initialized")
87
+ self._logger.info("Session manager initialized successfully")
88
88
 
89
89
  @property
90
90
  def metadata(self) -> MetaData:
@@ -313,8 +313,8 @@ class ServiceManager:
313
313
 
314
314
  def _initialize_clients(self) -> None:
315
315
  #* Initialize google clients
316
- secret = GoogleSecretManager(logs_dir=self._logs_dir, google_cloud_logging=self._google_cloud_logging)
317
- storage = GoogleCloudStorage(logs_dir=self._logs_dir, google_cloud_logging=self._google_cloud_logging)
316
+ secret = GoogleSecretManager(**self._log_config.model_dump())
317
+ storage = GoogleCloudStorage(**self._log_config.model_dump())
318
318
  self._google_clients = GoogleClientManagers(secret=secret, storage=storage)
319
319
  #* Initialize http clients
320
320
  self._http_client = HTTPClientManager
@@ -322,9 +322,7 @@ class ServiceManager:
322
322
  #* Initialize maleo clients
323
323
  self._maleo_clients = MaleoClientManagers()
324
324
  if self._maleo_client_manager_classes.metadata is not None and issubclass(self._maleo_client_manager_classes.metadata, MaleoClientManager):
325
- self._loggers.application.info("Initializing %s client manager", self._configs.client.maleo.metadata.key)
326
325
  self._maleo_clients.metadata = self._maleo_client_manager_classes.metadata(**self._configs.client.maleo.metadata.model_dump(), **self._log_config.model_dump())
327
- self._loggers.application.info("%s client manager initialized successfully", self._configs.client.maleo.metadata.key)
328
326
  self._clients = ClientManagers(google=self._google_clients, http=self._http_client, maleo=self._maleo_clients)
329
327
 
330
328
  @property
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.1.13
3
+ Version: 0.1.15
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "maleo_foundation"
7
- version = "0.1.13"
7
+ version = "0.1.15"
8
8
  description = "Foundation package for Maleo"
9
9
  authors = [
10
10
  { name = "Agra Bima Yuda", email = "agra@nexmedis.com" }