rate-api-python 1.0.3__py3-none-any.whl → 1.0.4__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.
rate_api/__init__.py CHANGED
@@ -12,7 +12,7 @@ import urllib.error
12
12
  import urllib.parse
13
13
  import urllib.request
14
14
 
15
- __version__ = "1.0.3"
15
+ __version__ = "1.0.4"
16
16
  __all__ = ["RateApiClient", "RateApiError", "RateLimitError", "RateApiTimeoutError"]
17
17
 
18
18
 
@@ -71,6 +71,28 @@ class RateApiClient:
71
71
  """Lean plan-quota / remaining-requests view."""
72
72
  return self._get("quota")
73
73
 
74
+ def list_alerts(self):
75
+ """List rate alerts on this key (Business+)."""
76
+ return self._get("alerts")
77
+
78
+ def create_alert(self, from_currency, to_currency, direction, threshold, notify_url=None):
79
+ """Create a rate alert (Business+). notify_url is an optional signed webhook target."""
80
+ body = {
81
+ "from": from_currency,
82
+ "to": to_currency,
83
+ "direction": direction,
84
+ "threshold": threshold,
85
+ }
86
+ if notify_url:
87
+ body["notify_url"] = notify_url
88
+ return self._request(f"{self.base_url}/{self.api_key}/alerts", {}, method="POST", body=body)
89
+
90
+ def delete_alert(self, alert_id):
91
+ """Delete a rate alert by id (Business+)."""
92
+ return self._request(
93
+ f"{self.base_url}/{self.api_key}/alerts/{urllib.parse.quote(str(alert_id))}", {}, method="DELETE"
94
+ )
95
+
74
96
  def health(self):
75
97
  """Public service status + rate-data freshness (no key needed)."""
76
98
  return self._request(f"{self.base_url}/health", {})
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rate-api-python
3
- Version: 1.0.3
3
+ Version: 1.0.4
4
4
  Summary: Official Python client for the Rate-API.com exchange-rate & crypto API
5
5
  Author-email: Vilgar <digitalbrainsam@gmail.com>
6
6
  License: MIT
@@ -0,0 +1,6 @@
1
+ rate_api/__init__.py,sha256=CvHxoRggysocFSpybe0cDroi5EkypF1MAlyAadrLpEo,7418
2
+ rate_api_python-1.0.4.dist-info/licenses/LICENSE,sha256=nCjIn_oDw98qUrGtfT5o19Qk02nDpkr3xbKgFtu3Z0A,1069
3
+ rate_api_python-1.0.4.dist-info/METADATA,sha256=ZTXquk2M2qrkCTuB20H5AQrqlUkHbZ1L7AmvZg-6Zfw,3713
4
+ rate_api_python-1.0.4.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
5
+ rate_api_python-1.0.4.dist-info/top_level.txt,sha256=y8GBQa9yzwxT17UjU9xreA4yPbHqup7c0ryMbx1gYzI,9
6
+ rate_api_python-1.0.4.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- rate_api/__init__.py,sha256=CCLo6o7REOyFcqTcJULKSyEoNHVCvIbIbLZa-0-_8pU,6532
2
- rate_api_python-1.0.3.dist-info/licenses/LICENSE,sha256=nCjIn_oDw98qUrGtfT5o19Qk02nDpkr3xbKgFtu3Z0A,1069
3
- rate_api_python-1.0.3.dist-info/METADATA,sha256=8kLKSBgWirgKwyJX_HxMIm9r5tRm90VQyEbD0v0d-GM,3713
4
- rate_api_python-1.0.3.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
5
- rate_api_python-1.0.3.dist-info/top_level.txt,sha256=y8GBQa9yzwxT17UjU9xreA4yPbHqup7c0ryMbx1gYzI,9
6
- rate_api_python-1.0.3.dist-info/RECORD,,