kirimel-python 2.0.0__tar.gz → 2.0.2__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 (22) hide show
  1. {kirimel_python-2.0.0 → kirimel_python-2.0.2}/PKG-INFO +3 -3
  2. {kirimel_python-2.0.0 → kirimel_python-2.0.2}/README.md +2 -2
  3. {kirimel_python-2.0.0 → kirimel_python-2.0.2}/kirimel/client.py +8 -8
  4. {kirimel_python-2.0.0 → kirimel_python-2.0.2}/kirimel/loyalty_http_client.py +9 -9
  5. {kirimel_python-2.0.0 → kirimel_python-2.0.2}/kirimel/resources/loyalty/customers.py +12 -0
  6. {kirimel_python-2.0.0 → kirimel_python-2.0.2}/kirimel_python.egg-info/PKG-INFO +3 -3
  7. {kirimel_python-2.0.0 → kirimel_python-2.0.2}/pyproject.toml +1 -1
  8. {kirimel_python-2.0.0 → kirimel_python-2.0.2}/LICENSE +0 -0
  9. {kirimel_python-2.0.0 → kirimel_python-2.0.2}/kirimel/__init__.py +0 -0
  10. {kirimel_python-2.0.0 → kirimel_python-2.0.2}/kirimel/exceptions.py +0 -0
  11. {kirimel_python-2.0.0 → kirimel_python-2.0.2}/kirimel/http_client.py +0 -0
  12. {kirimel_python-2.0.0 → kirimel_python-2.0.2}/kirimel/resources/__init__.py +0 -0
  13. {kirimel_python-2.0.0 → kirimel_python-2.0.2}/kirimel/resources/loyalty/__init__.py +0 -0
  14. {kirimel_python-2.0.0 → kirimel_python-2.0.2}/kirimel/resources/loyalty/points.py +0 -0
  15. {kirimel_python-2.0.0 → kirimel_python-2.0.2}/kirimel/resources/loyalty/vouchers.py +0 -0
  16. {kirimel_python-2.0.0 → kirimel_python-2.0.2}/kirimel/resources/loyalty/wallet.py +0 -0
  17. {kirimel_python-2.0.0 → kirimel_python-2.0.2}/kirimel_python.egg-info/SOURCES.txt +0 -0
  18. {kirimel_python-2.0.0 → kirimel_python-2.0.2}/kirimel_python.egg-info/dependency_links.txt +0 -0
  19. {kirimel_python-2.0.0 → kirimel_python-2.0.2}/kirimel_python.egg-info/requires.txt +0 -0
  20. {kirimel_python-2.0.0 → kirimel_python-2.0.2}/kirimel_python.egg-info/top_level.txt +0 -0
  21. {kirimel_python-2.0.0 → kirimel_python-2.0.2}/setup.cfg +0 -0
  22. {kirimel_python-2.0.0 → kirimel_python-2.0.2}/tests/test_client.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kirimel-python
3
- Version: 2.0.0
3
+ Version: 2.0.2
4
4
  Summary: Official KiriMel Python SDK
5
5
  Author-email: KiriMel <support@kirimel.com>
6
6
  License: MIT
@@ -526,8 +526,8 @@ client = kirimel.KiriMel(api_key='sk_test_xxx')
526
526
  # Loyalty API credentials (optional - only if using loyalty features)
527
527
  client = kirimel.KiriMel(
528
528
  api_key='sk_test_xxx',
529
- client_key='cli_test_xxx', # Or KIRIMEL_LOYALTY_CLIENT_KEY env var
530
- client_secret='your_secret_here' # Or KIRIMEL_LOYALTY_CLIENT_SECRET env var
529
+ loyalty_api_key='kl_test_xxx', # Or KIRIMEL_LOYALTY_API_KEY env var
530
+ key_secret='your_secret_here' # Or KIRIMEL_LOYALTY_KEY_SECRET env var
531
531
  )
532
532
  ```
533
533
 
@@ -496,8 +496,8 @@ client = kirimel.KiriMel(api_key='sk_test_xxx')
496
496
  # Loyalty API credentials (optional - only if using loyalty features)
497
497
  client = kirimel.KiriMel(
498
498
  api_key='sk_test_xxx',
499
- client_key='cli_test_xxx', # Or KIRIMEL_LOYALTY_CLIENT_KEY env var
500
- client_secret='your_secret_here' # Or KIRIMEL_LOYALTY_CLIENT_SECRET env var
499
+ loyalty_api_key='kl_test_xxx', # Or KIRIMEL_LOYALTY_API_KEY env var
500
+ key_secret='your_secret_here' # Or KIRIMEL_LOYALTY_KEY_SECRET env var
501
501
  )
502
502
  ```
503
503
 
@@ -43,8 +43,8 @@ class KiriMel:
43
43
  base_url: str = "https://kirimel.com/api",
44
44
  timeout: int = 30,
45
45
  retries: int = 3,
46
- client_key: Optional[str] = None,
47
- client_secret: Optional[str] = None,
46
+ loyalty_api_key: Optional[str] = None,
47
+ key_secret: Optional[str] = None,
48
48
  ):
49
49
  """
50
50
  Create a new API client
@@ -54,8 +54,8 @@ class KiriMel:
54
54
  base_url: Base URL (default: https://kirimel.com/api)
55
55
  timeout: Request timeout in seconds (default: 30)
56
56
  retries: Number of retries (default: 3)
57
- client_key: Loyalty API client key (or use KIRIMEL_LOYALTY_CLIENT_KEY env var)
58
- client_secret: Loyalty API client secret (or use KIRIMEL_LOYALTY_CLIENT_SECRET env var)
57
+ loyalty_api_key: Loyalty API key (or use KIRIMEL_LOYALTY_API_KEY env var)
58
+ key_secret: Loyalty API key secret (or use KIRIMEL_LOYALTY_KEY_SECRET env var)
59
59
  """
60
60
  self._http_client = HttpClient(
61
61
  api_key=api_key,
@@ -84,8 +84,8 @@ class KiriMel:
84
84
 
85
85
  # Store credentials for lazy initialization
86
86
  self._loyalty_base_url = base_url.replace("/api", "")
87
- self._loyalty_client_key = client_key or os.getenv("KIRIMEL_LOYALTY_CLIENT_KEY")
88
- self._loyalty_client_secret = client_secret or os.getenv("KIRIMEL_LOYALTY_CLIENT_SECRET")
87
+ self._loyalty_api_key = loyalty_api_key or os.getenv("KIRIMEL_LOYALTY_API_KEY")
88
+ self._loyalty_key_secret = key_secret or os.getenv("KIRIMEL_LOYALTY_KEY_SECRET")
89
89
  self._loyalty_timeout = timeout
90
90
  self._loyalty_retries = retries
91
91
 
@@ -93,8 +93,8 @@ class KiriMel:
93
93
  """Initialize loyalty HTTP client (lazy initialization)"""
94
94
  if self._loyalty_http_client is None:
95
95
  self._loyalty_http_client = LoyaltyHttpClient(
96
- client_key=self._loyalty_client_key,
97
- client_secret=self._loyalty_client_secret,
96
+ api_key=self._loyalty_api_key,
97
+ key_secret=self._loyalty_key_secret,
98
98
  base_url=self._loyalty_base_url,
99
99
  timeout=self._loyalty_timeout,
100
100
  retries=self._loyalty_retries,
@@ -21,22 +21,22 @@ class LoyaltyHttpClient:
21
21
 
22
22
  def __init__(
23
23
  self,
24
- client_key: Optional[str] = None,
25
- client_secret: Optional[str] = None,
24
+ api_key: Optional[str] = None,
25
+ key_secret: Optional[str] = None,
26
26
  base_url: str = "https://kirimel.com",
27
27
  timeout: int = 30,
28
28
  retries: int = 3,
29
29
  ):
30
30
  self.base_url = base_url.rstrip("/")
31
- self.client_key = client_key or os.getenv("KIRIMEL_LOYALTY_CLIENT_KEY") or ""
32
- self.client_secret = client_secret or os.getenv("KIRIMEL_LOYALTY_CLIENT_SECRET") or ""
31
+ self.api_key = api_key or os.getenv("KIRIMEL_LOYALTY_API_KEY") or ""
32
+ self.key_secret = key_secret or os.getenv("KIRIMEL_LOYALTY_KEY_SECRET") or ""
33
33
  self.timeout = timeout
34
34
  self.retries = retries
35
35
 
36
- if not self.client_key or not self.client_secret:
36
+ if not self.api_key or not self.key_secret:
37
37
  raise AuthenticationException(
38
- "Loyalty API requires both client_key and client_secret. "
39
- "Set KIRIMEL_LOYALTY_CLIENT_KEY and KIRIMEL_LOYALTY_CLIENT_SECRET environment variables, "
38
+ "Loyalty API requires both api_key and key_secret. "
39
+ "Set KIRIMEL_LOYALTY_API_KEY and KIRIMEL_LOYALTY_KEY_SECRET environment variables, "
40
40
  "or pass them in the config."
41
41
  )
42
42
 
@@ -86,7 +86,7 @@ class LoyaltyHttpClient:
86
86
  "Content-Type": "application/json",
87
87
  "Accept": "application/json",
88
88
  "User-Agent": "KiriMel-Python-SDK/2.0.0",
89
- "X-Client-Key": self.client_key,
89
+ "X-API-Key": self.api_key,
90
90
  "X-Timestamp": timestamp,
91
91
  "X-Signature": signature,
92
92
  }
@@ -119,7 +119,7 @@ class LoyaltyHttpClient:
119
119
  """Calculate HMAC SHA256 signature"""
120
120
  signing_string = f"{timestamp}.{payload}"
121
121
  signature = hmac.new(
122
- self.client_secret.encode(), # type: ignore[arg-type]
122
+ self.key_secret.encode(), # type: ignore[arg-type]
123
123
  signing_string.encode(),
124
124
  hashlib.sha256,
125
125
  ).hexdigest()
@@ -33,6 +33,18 @@ class Customers:
33
33
  """
34
34
  return self._http.post("/api/loyalty/customers/lookup", data)
35
35
 
36
+ def lookup_by_email(self, email: str) -> Dict[str, Any]:
37
+ """
38
+ Look up customer by email address
39
+
40
+ Args:
41
+ email: Customer email address
42
+
43
+ Returns:
44
+ Customer data
45
+ """
46
+ return self._http.get("/api/loyalty/customers/lookup-by-email", {"email": email})
47
+
36
48
  def get(self, customer_id: str) -> Dict[str, Any]:
37
49
  """
38
50
  Get customer profile
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kirimel-python
3
- Version: 2.0.0
3
+ Version: 2.0.2
4
4
  Summary: Official KiriMel Python SDK
5
5
  Author-email: KiriMel <support@kirimel.com>
6
6
  License: MIT
@@ -526,8 +526,8 @@ client = kirimel.KiriMel(api_key='sk_test_xxx')
526
526
  # Loyalty API credentials (optional - only if using loyalty features)
527
527
  client = kirimel.KiriMel(
528
528
  api_key='sk_test_xxx',
529
- client_key='cli_test_xxx', # Or KIRIMEL_LOYALTY_CLIENT_KEY env var
530
- client_secret='your_secret_here' # Or KIRIMEL_LOYALTY_CLIENT_SECRET env var
529
+ loyalty_api_key='kl_test_xxx', # Or KIRIMEL_LOYALTY_API_KEY env var
530
+ key_secret='your_secret_here' # Or KIRIMEL_LOYALTY_KEY_SECRET env var
531
531
  )
532
532
  ```
533
533
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "kirimel-python"
3
- version = "2.0.0"
3
+ version = "2.0.2"
4
4
  description = "Official KiriMel Python SDK"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.8"
File without changes
File without changes