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.
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/CHANGELOG.md +6 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/PKG-INFO +38 -2
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/README.md +37 -1
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/pyproject.toml +1 -1
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/client.py +7 -2
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/http.py +1 -4
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/uv.lock +2 -2
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/.gitignore +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/.pre-commit-config.yaml +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/.vscode/extensions.json +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/.vscode/launch.json +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/.vscode/settings.json +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/.vscode/tasks.json +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/LICENSE +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/NOTICE +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/examples/01_client_setup.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/examples/02_list_workspaces.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/examples/03_list_regions.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/examples/04_list_rules.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/examples/05_get_rule.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/examples/06_create_rule.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/examples/07_update_rule.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/examples/08_delete_rule.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/examples/README.md +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/examples/__init__.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/__init__.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/endpoints/__init__.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/endpoints/endpoint.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/endpoints/regions.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/endpoints/rules.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/endpoints/v1.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/endpoints/workspaces.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/errors.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/models/__init__.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/models/deserialize.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/models/errors.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/models/region.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/models/rule.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/models/workspace.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/src/uptimer/py.typed +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/tests/__init__.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/tests/conftest.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/tests/integrations/__init__.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/tests/integrations/conftest.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/tests/integrations/test_workspaces.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/tests/test_client.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/tests/test_endpoint.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/tests/test_regions_endpoint.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/tests/test_rules_endpoint.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/tests/test_workspaces_endpoint.py +0 -0
- {uptimer_python_sdk-0.2.0 → uptimer_python_sdk-0.3.0}/tools/mypy-diff.sh +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: uptimer-python-sdk
|
|
3
|
-
Version: 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
|
-
|
|
16
|
+

|
|
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
|
-
|
|
3
|
+

|
|
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
|
|
@@ -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
|
|
13
|
-
self.
|
|
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
|
|
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,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|