maleo-foundation 0.0.77__py3-none-any.whl → 0.0.78__py3-none-any.whl

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.
@@ -4,6 +4,7 @@ from typing import AsyncGenerator, Optional
4
4
 
5
5
  class HTTPClientManager:
6
6
  client:Optional[httpx.AsyncClient] = None
7
+ base_url:Optional[str] = None
7
8
 
8
9
  @classmethod
9
10
  def initialize(cls) -> None:
@@ -20,12 +21,12 @@ class HTTPClientManager:
20
21
  yield cls.client
21
22
 
22
23
  @classmethod
23
- async def inject(cls) -> AsyncGenerator[httpx.AsyncClient, None]:
24
+ async def inject_client(cls) -> AsyncGenerator[httpx.AsyncClient, None]:
24
25
  return cls._client_handler()
25
26
 
26
27
  @classmethod
27
28
  @asynccontextmanager
28
- async def get(cls) -> AsyncGenerator[httpx.AsyncClient, None]:
29
+ async def get_client(cls) -> AsyncGenerator[httpx.AsyncClient, None]:
29
30
  """
30
31
  Async context manager for manual HTTP client handling.
31
32
  Supports `async with HTTPClientManager.get() as client:`
@@ -33,9 +34,17 @@ class HTTPClientManager:
33
34
  async for client in cls._client_handler():
34
35
  yield client
35
36
 
37
+ @classmethod
38
+ def get_url(cls) -> str:
39
+ if cls.base_url is None:
40
+ raise RuntimeError("Base URL has not been initialized. Call initialize first.")
41
+ return cls.base_url
42
+
36
43
  @classmethod
37
44
  async def dispose(cls) -> None:
38
45
  """Dispose of the HTTP client and release any resources."""
39
46
  if cls.client is not None:
40
47
  await cls.client.aclose()
41
- cls.client = None
48
+ cls.client = None
49
+ if cls.base_url is not None:
50
+ cls.base_url = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.0.77
3
+ Version: 0.0.78
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -5,7 +5,7 @@ maleo_foundation/extended_types.py,sha256=pIKt-_9tby4rmune3fmWcCW_mohaNRh_1lywBm
5
5
  maleo_foundation/types.py,sha256=aKXnIgEhYGSfFqNMGLc4qIKGkINBRpkOo9R9cb2CbwI,2414
6
6
  maleo_foundation/clients/__init__.py,sha256=W8vydJYeDEi6gdmOZSBFSSDsfZJtb8C05CHErZgsZ30,188
7
7
  maleo_foundation/clients/general/__init__.py,sha256=l9eQrBeLW4aXtGU5aK3i6fD-msVR4526W7D9V8WCXIg,91
8
- maleo_foundation/clients/general/http.py,sha256=Awvs470hgdhZSZW_uoIFJGcJ5hcfDEIX0A2yUaP9UCA,1353
8
+ maleo_foundation/clients/general/http.py,sha256=pObW6EaMeLDNsRZ9QJPzfhZDzcZ33kCsb-9Yfoh2MA4,1670
9
9
  maleo_foundation/clients/google/__init__.py,sha256=1uv6nF9QbATsSAcMimQOT7Y-eBljjDunBojNX6oAtS8,90
10
10
  maleo_foundation/clients/google/cloud/__init__.py,sha256=WGMPxEKKdkz3XGY5dZn9E-nYhD1kv1MgRHbmVnky4zk,245
11
11
  maleo_foundation/clients/google/cloud/logging.py,sha256=b-q6Mhlt2Vl5HBh-YXeEEfGu1TMFK_XIJa55haMvkpA,1552
@@ -54,7 +54,7 @@ maleo_foundation/utils/logger.py,sha256=978P57JOhGR-WIu7xdPXBIwd3JrfLLA8WerVzxhE
54
54
  maleo_foundation/utils/query.py,sha256=ODQ3adOYQNj5E2cRW9ytbjBz56nEDcnfq8mQ6YZbCCM,4375
55
55
  maleo_foundation/utils/formatter/__init__.py,sha256=iKf5YCbEdg1qKnFHyKqqcQbqAqEeRUf8mhI3v3dQoj8,78
56
56
  maleo_foundation/utils/formatter/case.py,sha256=TmvvlfzGdC_omMTB5vAa40TZBxQ3hnr-SYeo0M52Rlg,1352
57
- maleo_foundation-0.0.77.dist-info/METADATA,sha256=nf17vxIzz4BP4giMXziXeGod88Y4GepgpzWnpCI3rBY,3160
58
- maleo_foundation-0.0.77.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
59
- maleo_foundation-0.0.77.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
60
- maleo_foundation-0.0.77.dist-info/RECORD,,
57
+ maleo_foundation-0.0.78.dist-info/METADATA,sha256=WseeG9gJK0d7mEiO38k8U3Pb79Gl2Gpfy3UVi5aXctc,3160
58
+ maleo_foundation-0.0.78.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
59
+ maleo_foundation-0.0.78.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
60
+ maleo_foundation-0.0.78.dist-info/RECORD,,