uptimer-python-sdk 0.2.0__tar.gz → 0.3.0__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 (51) hide show
  1. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/CHANGELOG.md +6 -0
  2. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/PKG-INFO +38 -2
  3. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/README.md +37 -1
  4. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/pyproject.toml +1 -1
  5. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/client.py +7 -2
  6. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/http.py +1 -4
  7. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/uv.lock +2 -2
  8. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/.gitignore +0 -0
  9. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/.pre-commit-config.yaml +0 -0
  10. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/.vscode/extensions.json +0 -0
  11. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/.vscode/launch.json +0 -0
  12. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/.vscode/settings.json +0 -0
  13. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/.vscode/tasks.json +0 -0
  14. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/LICENSE +0 -0
  15. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/NOTICE +0 -0
  16. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/examples/01_client_setup.py +0 -0
  17. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/examples/02_list_workspaces.py +0 -0
  18. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/examples/03_list_regions.py +0 -0
  19. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/examples/04_list_rules.py +0 -0
  20. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/examples/05_get_rule.py +0 -0
  21. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/examples/06_create_rule.py +0 -0
  22. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/examples/07_update_rule.py +0 -0
  23. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/examples/08_delete_rule.py +0 -0
  24. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/examples/README.md +0 -0
  25. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/examples/__init__.py +0 -0
  26. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/__init__.py +0 -0
  27. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/endpoints/__init__.py +0 -0
  28. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/endpoints/endpoint.py +0 -0
  29. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/endpoints/regions.py +0 -0
  30. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/endpoints/rules.py +0 -0
  31. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/endpoints/v1.py +0 -0
  32. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/endpoints/workspaces.py +0 -0
  33. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/errors.py +0 -0
  34. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/models/__init__.py +0 -0
  35. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/models/deserialize.py +0 -0
  36. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/models/errors.py +0 -0
  37. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/models/region.py +0 -0
  38. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/models/rule.py +0 -0
  39. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/models/workspace.py +0 -0
  40. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/py.typed +0 -0
  41. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/tests/__init__.py +0 -0
  42. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/tests/conftest.py +0 -0
  43. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/tests/integrations/__init__.py +0 -0
  44. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/tests/integrations/conftest.py +0 -0
  45. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/tests/integrations/test_workspaces.py +0 -0
  46. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/tests/test_client.py +0 -0
  47. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/tests/test_endpoint.py +0 -0
  48. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/tests/test_regions_endpoint.py +0 -0
  49. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/tests/test_rules_endpoint.py +0 -0
  50. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/tests/test_workspaces_endpoint.py +0 -0
  51. {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/tools/mypy-diff.sh +0 -0
@@ -1,3 +1,9 @@
1
+ ## 0.3.0 (2025-08-19)
2
+
3
+ ### Feat
4
+
5
+ - self-hosted client now requires a base_url, added cloud client, updated docs
6
+
1
7
  ## 0.2.0 (2025-08-10)
2
8
 
3
9
  ### Feat
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uptimer-python-sdk
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: A Python SDK for uptimer
5
5
  Project-URL: Repository, https://github.com/myuptime-info/uptimer-python-sdk
6
6
  Author-email: Roman Zadoev <zadoev@gmail.com>
@@ -13,7 +13,11 @@ Description-Content-Type: text/markdown
13
13
 
14
14
  # Uptimer Python SDK
15
15
 
16
- A Python SDK for [uptimer](https://uptimer.myuptime.info/) - a monitoring and uptime checking service.
16
+ ![Uptimer](https://static.myuptime.info/61uvxp/icon.png)
17
+
18
+ A Python SDK for uptimer - a monitoring and uptime checking service.
19
+ * [uptimer self-hosted](https://uptimer.myuptime.info)
20
+ * [myuptime.info](https://myuptime.info)
17
21
 
18
22
  ## License
19
23
 
@@ -21,8 +25,40 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
21
25
 
22
26
  For third-party license information, see the [NOTICE](NOTICE) file.
23
27
 
28
+ ## Installation
29
+
30
+ ```shell
31
+ pip install uptimer-python-sdk
32
+ ```
33
+
34
+ or
35
+ ```shell
36
+ uv add uptimer-python-sdk
37
+ ```
38
+
24
39
  ## Usage
25
40
 
41
+ ### Create client
42
+
43
+ #### self-hosted
44
+
45
+ ```python
46
+ from uptimer.client import UptimerClient
47
+ client = UptimerClient(
48
+ api_key="your-api-key-here",
49
+ base_url="http://127.0.0.1:2517/api", # or your custom base URL
50
+ )
51
+ ```
52
+
53
+ #### cloud
54
+ ```python
55
+ from uptimer.client import UptimerCloudClient
56
+ client = UptimerCloudClient(
57
+ api_key="your-api-key-here",
58
+ )
59
+ ```
60
+
61
+ ### Basic example
26
62
  ```python
27
63
  from uptimer.client import UptimerClient
28
64
  from uptimer.models.rule import CreateRuleRequest, RuleRequest, RuleResponse, RuleResponseBody
@@ -1,6 +1,10 @@
1
1
  # Uptimer Python SDK
2
2
 
3
- A Python SDK for [uptimer](https://uptimer.myuptime.info/) - a monitoring and uptime checking service.
3
+ ![Uptimer](https://static.myuptime.info/61uvxp/icon.png)
4
+
5
+ A Python SDK for uptimer - a monitoring and uptime checking service.
6
+ * [uptimer self-hosted](https://uptimer.myuptime.info)
7
+ * [myuptime.info](https://myuptime.info)
4
8
 
5
9
  ## License
6
10
 
@@ -8,8 +12,40 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
8
12
 
9
13
  For third-party license information, see the [NOTICE](NOTICE) file.
10
14
 
15
+ ## Installation
16
+
17
+ ```shell
18
+ pip install uptimer-python-sdk
19
+ ```
20
+
21
+ or
22
+ ```shell
23
+ uv add uptimer-python-sdk
24
+ ```
25
+
11
26
  ## Usage
12
27
 
28
+ ### Create client
29
+
30
+ #### self-hosted
31
+
32
+ ```python
33
+ from uptimer.client import UptimerClient
34
+ client = UptimerClient(
35
+ api_key="your-api-key-here",
36
+ base_url="http://127.0.0.1:2517/api", # or your custom base URL
37
+ )
38
+ ```
39
+
40
+ #### cloud
41
+ ```python
42
+ from uptimer.client import UptimerCloudClient
43
+ client = UptimerCloudClient(
44
+ api_key="your-api-key-here",
45
+ )
46
+ ```
47
+
48
+ ### Basic example
13
49
  ```python
14
50
  from uptimer.client import UptimerClient
15
51
  from uptimer.models.rule import CreateRuleRequest, RuleRequest, RuleResponse, RuleResponseBody
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "uptimer-python-sdk"
7
- version = "0.2.0"
7
+ version = "0.3.0"
8
8
  description = "A Python SDK for uptimer"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -9,8 +9,8 @@ from uptimer.http import UptimerHttpLib
9
9
  class UptimerClient:
10
10
  v1: V1Endpoint
11
11
 
12
- def __init__(self, api_key: str, base_url: str | None = None):
13
- self.set_uptimer_http_lib(UptimerHttpLib(api_key, base_url))
12
+ def __init__(self, api_key: str, base_url: str):
13
+ self._http_lib = UptimerHttpLib(api_key, base_url)
14
14
  self.v1 = V1Endpoint(self._http_lib)
15
15
 
16
16
  def version(self) -> str:
@@ -19,3 +19,8 @@ class UptimerClient:
19
19
 
20
20
  def set_uptimer_http_lib(self, http_lib: UptimerHttpLib) -> None:
21
21
  self._http_lib = http_lib
22
+
23
+
24
+ class UptimerCloudClient(UptimerClient):
25
+ def __init__(self, api_key: str):
26
+ super().__init__(api_key, "https://api.myuptime.info")
@@ -13,10 +13,7 @@ class WorkspacesEndpoint(BaseEndpoint):
13
13
 
14
14
 
15
15
  class UptimerHttpLib:
16
- def __init__(self, api_key: str, base_url: str | None = None):
17
- if base_url is None:
18
- base_url = "https://api.uptimer.com"
19
-
16
+ def __init__(self, api_key: str, base_url: str):
20
17
  self._base_url = base_url.rstrip("/")
21
18
  self._http_client = httpx.Client(
22
19
  base_url=base_url,
@@ -1147,8 +1147,8 @@ wheels = [
1147
1147
  ]
1148
1148
 
1149
1149
  [[package]]
1150
- name = "uptimer"
1151
- version = "0.2.0"
1150
+ name = "uptimer-python-sdk"
1151
+ version = "0.3.0"
1152
1152
  source = { editable = "." }
1153
1153
  dependencies = [
1154
1154
  { name = "httpx" },