rate-api-python 1.0.3__tar.gz → 1.0.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.
- {rate_api_python-1.0.3 → rate_api_python-1.0.4}/PKG-INFO +1 -1
- {rate_api_python-1.0.3 → rate_api_python-1.0.4}/pyproject.toml +1 -1
- {rate_api_python-1.0.3 → rate_api_python-1.0.4}/rate_api/__init__.py +23 -1
- {rate_api_python-1.0.3 → rate_api_python-1.0.4}/rate_api_python.egg-info/PKG-INFO +1 -1
- {rate_api_python-1.0.3 → rate_api_python-1.0.4}/LICENSE +0 -0
- {rate_api_python-1.0.3 → rate_api_python-1.0.4}/README.md +0 -0
- {rate_api_python-1.0.3 → rate_api_python-1.0.4}/rate_api_python.egg-info/SOURCES.txt +0 -0
- {rate_api_python-1.0.3 → rate_api_python-1.0.4}/rate_api_python.egg-info/dependency_links.txt +0 -0
- {rate_api_python-1.0.3 → rate_api_python-1.0.4}/rate_api_python.egg-info/top_level.txt +0 -0
- {rate_api_python-1.0.3 → rate_api_python-1.0.4}/setup.cfg +0 -0
|
@@ -12,7 +12,7 @@ import urllib.error
|
|
|
12
12
|
import urllib.parse
|
|
13
13
|
import urllib.request
|
|
14
14
|
|
|
15
|
-
__version__ = "1.0.
|
|
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", {})
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rate_api_python-1.0.3 → rate_api_python-1.0.4}/rate_api_python.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|