pmdb_utils 0.3.2__tar.gz → 0.3.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pmdb_utils
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Summary: Add your description here
5
5
  Author-email: saebod <saebod@hotmail.com>
6
6
  Requires-Python: >=3.13
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pmdb_utils"
3
- version = "0.3.2"
3
+ version = "0.3.4"
4
4
  description = "Add your description here"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -0,0 +1,49 @@
1
+ import os
2
+
3
+
4
+ class StorageOptions:
5
+ """
6
+ Configuration class for AWS/MinIO storage credentials and endpoints.
7
+ Allows initialization from arguments or environment variables.
8
+ """
9
+
10
+ def __init__(
11
+ self,
12
+ access_key_id=None,
13
+ secret_access_key=None,
14
+ endpoint_url=None,
15
+ allow_http="true",
16
+ ):
17
+ """
18
+ Initialize DeltaStorageOptions.
19
+ Args:
20
+ aws_access_key_id (str, optional): AWS access key ID. Defaults to None.
21
+ aws_secret_access_key (str, optional): AWS secret access key. Defaults to None.
22
+ aws_endpoint_url (str, optional): AWS/MinIO endpoint URL. Defaults to None.
23
+ region (str, optional): AWS region. Defaults to None.
24
+ allow_http (str, optional): Allow HTTP connections. Defaults to "true".
25
+ """
26
+ self.access_key_id = access_key_id or os.getenv("MINIO_ROOT_USER")
27
+ self.secret_access_key = secret_access_key or os.getenv("MINIO_ROOT_PASSWORD")
28
+ self.endpoint_url = endpoint_url or os.getenv("MINIO_ENDPOINT_URL")
29
+ self.allow_http = allow_http
30
+
31
+ @property
32
+ def minio(self) -> dict:
33
+ """
34
+ Return a dictionary of credentials and endpoint for MinIO/AWS SDKs.
35
+ Returns:
36
+ dict: Dictionary with keys 'aws_access_key_id', 'aws_secret_access_key', 'endpoint_url', 'allow_http'.
37
+ """
38
+ if (
39
+ not self.access_key_id
40
+ or not self.secret_access_key
41
+ or not self.endpoint_url
42
+ ):
43
+ raise ValueError("AWS credentials and endpoint URL must be provided.")
44
+ return {
45
+ "aws_access_key_id": self.access_key_id,
46
+ "aws_secret_access_key": self.secret_access_key,
47
+ "endpoint_url": self.endpoint_url,
48
+ "allow_http": self.allow_http,
49
+ }
File without changes
File without changes
File without changes
File without changes