pythonkuma 0.5.2__tar.gz → 0.5.3__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.
- {pythonkuma-0.5.2 → pythonkuma-0.5.3}/.gitignore +1 -1
- {pythonkuma-0.5.2 → pythonkuma-0.5.3}/PKG-INFO +5 -5
- {pythonkuma-0.5.2 → pythonkuma-0.5.3}/README.md +1 -1
- {pythonkuma-0.5.2 → pythonkuma-0.5.3}/pyproject.toml +37 -15
- {pythonkuma-0.5.2 → pythonkuma-0.5.3}/pythonkuma/__init__.py +1 -1
- {pythonkuma-0.5.2 → pythonkuma-0.5.3}/pythonkuma/models.py +2 -1
- {pythonkuma-0.5.2 → pythonkuma-0.5.3}/pythonkuma/uptimekuma.py +5 -3
- {pythonkuma-0.5.2 → pythonkuma-0.5.3}/LICENSE +0 -0
- {pythonkuma-0.5.2 → pythonkuma-0.5.3}/pythonkuma/exceptions.py +0 -0
- {pythonkuma-0.5.2 → pythonkuma-0.5.3}/pythonkuma/py.typed +0 -0
- {pythonkuma-0.5.2 → pythonkuma-0.5.3}/pythonkuma/update.py +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: pythonkuma
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.3
|
|
4
4
|
Summary: Simple Python wrapper for Uptime Kuma
|
|
5
5
|
Project-URL: Source, https://github.com/tr4nt0r/pythonkuma
|
|
6
6
|
Project-URL: Documentation, https://tr4nt0r.github.io/pythonkuma
|
|
7
|
-
Author-email: Manfred Dennerlein Rodelo <
|
|
7
|
+
Author-email: Manfred Dennerlein Rodelo <tr4nt0r@uber.space>
|
|
8
8
|
License-Expression: MIT
|
|
9
9
|
License-File: LICENSE
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
12
|
Requires-Python: >=3.12
|
|
13
|
-
Requires-Dist: aiohttp>=3.
|
|
13
|
+
Requires-Dist: aiohttp>=3.14.0
|
|
14
14
|
Requires-Dist: mashumaro>=3.13.1
|
|
15
15
|
Requires-Dist: prometheus-client>=0.21.0
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
@@ -87,7 +87,7 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
|
|
|
87
87
|
|
|
88
88
|
## ❤️ Support
|
|
89
89
|
|
|
90
|
-
If you find this project useful, consider
|
|
90
|
+
If you find this project useful, consider sponsoring me on [GitHub](https://github.com/sponsors/tr4nt0r)!
|
|
91
91
|
|
|
92
92
|
---
|
|
93
93
|
|
|
@@ -70,7 +70,7 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
|
|
|
70
70
|
|
|
71
71
|
## ❤️ Support
|
|
72
72
|
|
|
73
|
-
If you find this project useful, consider
|
|
73
|
+
If you find this project useful, consider sponsoring me on [GitHub](https://github.com/sponsors/tr4nt0r)!
|
|
74
74
|
|
|
75
75
|
---
|
|
76
76
|
|
|
@@ -10,15 +10,14 @@ readme = "README.md"
|
|
|
10
10
|
license = "MIT"
|
|
11
11
|
requires-python = ">=3.12"
|
|
12
12
|
authors = [
|
|
13
|
-
{ name = "Manfred Dennerlein Rodelo", email = "
|
|
14
|
-
{ name = "Jayakorn Karikan", email = "jayakornk@gmail.com" },
|
|
13
|
+
{ name = "Manfred Dennerlein Rodelo", email = "tr4nt0r@uber.space" },
|
|
15
14
|
]
|
|
16
15
|
classifiers = [
|
|
17
16
|
"Operating System :: OS Independent",
|
|
18
17
|
"Programming Language :: Python :: 3",
|
|
19
18
|
]
|
|
20
19
|
dependencies = [
|
|
21
|
-
"aiohttp>=3.
|
|
20
|
+
"aiohttp>=3.14.0",
|
|
22
21
|
"prometheus-client>=0.21.0",
|
|
23
22
|
"mashumaro>=3.13.1",
|
|
24
23
|
]
|
|
@@ -41,24 +40,34 @@ include = [
|
|
|
41
40
|
python = ["3.14", "3.13", "3.12"]
|
|
42
41
|
|
|
43
42
|
[tool.hatch.envs.default]
|
|
43
|
+
python = "3.14"
|
|
44
44
|
dependencies = [
|
|
45
|
-
"ruff==0.16.
|
|
45
|
+
"ruff==0.16.7",
|
|
46
46
|
"aiohttp==3.14.3",
|
|
47
47
|
"prometheus-client==0.26.0",
|
|
48
48
|
"mashumaro==3.22",
|
|
49
|
-
"mkdocs-material==9.7.7",
|
|
50
|
-
"mkdocstrings[python]==1.0.6",
|
|
51
49
|
"pytest-asyncio==1.4.0",
|
|
52
50
|
"pytest==9.1.1",
|
|
53
51
|
"pytest-cov==7.1.0",
|
|
54
|
-
"syrupy==
|
|
52
|
+
"syrupy==6.0.0",
|
|
53
|
+
"prek==0.5.2",
|
|
55
54
|
]
|
|
56
55
|
|
|
57
|
-
[tool.hatch.envs.hatch-
|
|
56
|
+
[tool.hatch.envs.hatch-check-code]
|
|
57
|
+
config-path = "none"
|
|
58
|
+
dependencies = ["ruff==0.16.7"]
|
|
59
|
+
|
|
60
|
+
[tool.hatch.envs.hatch-check-fmt]
|
|
61
|
+
config-path = "none"
|
|
62
|
+
dependencies = ["ruff==0.16.7"]
|
|
63
|
+
|
|
64
|
+
[tool.hatch.envs.hatch-check-types]
|
|
65
|
+
template = "hatch-test"
|
|
58
66
|
dependencies = [
|
|
59
|
-
"
|
|
67
|
+
"pyrefly==1.3.0",
|
|
68
|
+
"syrupy==6.0.0",
|
|
60
69
|
]
|
|
61
|
-
|
|
70
|
+
|
|
62
71
|
|
|
63
72
|
[tool.pytest.ini_options]
|
|
64
73
|
addopts = "--cov=pythonkuma/ --cov-report=term-missing"
|
|
@@ -71,13 +80,20 @@ pythonpath = ["pythonkuma"]
|
|
|
71
80
|
extra-dependencies = [
|
|
72
81
|
"pytest-cov==7.1.0",
|
|
73
82
|
"pytest-asyncio==1.4.0",
|
|
74
|
-
"syrupy==
|
|
83
|
+
"syrupy==6.0.0",
|
|
75
84
|
]
|
|
76
85
|
extra-args = ["--cov-report=xml", "-vv"]
|
|
77
86
|
|
|
78
|
-
[tool.hatch.envs.
|
|
79
|
-
|
|
80
|
-
|
|
87
|
+
[tool.hatch.envs.docs]
|
|
88
|
+
detached = true
|
|
89
|
+
dependencies = [
|
|
90
|
+
"mkdocs-material==9.7.7",
|
|
91
|
+
"mkdocstrings[python]==1.0.6",
|
|
92
|
+
]
|
|
93
|
+
|
|
94
|
+
[tool.hatch.envs.docs.scripts]
|
|
95
|
+
serve = "mkdocs serve"
|
|
96
|
+
build = "mkdocs build"
|
|
81
97
|
|
|
82
98
|
[tool.ruff]
|
|
83
99
|
target-version = "py314"
|
|
@@ -123,4 +139,10 @@ fixture-parentheses = false
|
|
|
123
139
|
mark-parentheses = false
|
|
124
140
|
|
|
125
141
|
[tool.ruff.lint.pydocstyle]
|
|
126
|
-
convention = "numpy"
|
|
142
|
+
convention = "numpy"
|
|
143
|
+
|
|
144
|
+
[tool.pyrefly]
|
|
145
|
+
project-includes = [
|
|
146
|
+
"**/*.py*",
|
|
147
|
+
"**/*.ipynb",
|
|
148
|
+
]
|
|
@@ -31,6 +31,7 @@ class MonitorType(StrEnum):
|
|
|
31
31
|
SYSTEM_SERVICE = "system-service"
|
|
32
32
|
PM2 = "pm2"
|
|
33
33
|
REAL_BROWSER = "real-browser"
|
|
34
|
+
SFTP = "sftp"
|
|
34
35
|
# Special
|
|
35
36
|
GROUP = "group"
|
|
36
37
|
# Passive monitor type
|
|
@@ -64,7 +65,7 @@ class MonitorType(StrEnum):
|
|
|
64
65
|
UNKNOWN = "unknown"
|
|
65
66
|
|
|
66
67
|
@classmethod
|
|
67
|
-
def _missing_(cls,
|
|
68
|
+
def _missing_(cls, value: object) -> Self: # noqa: ARG003
|
|
68
69
|
"""Handle new and unknown monitor types."""
|
|
69
70
|
return cls.UNKNOWN
|
|
70
71
|
|
|
@@ -4,11 +4,11 @@ from http import HTTPStatus
|
|
|
4
4
|
from typing import Any
|
|
5
5
|
|
|
6
6
|
from aiohttp import (
|
|
7
|
-
BasicAuth,
|
|
8
7
|
ClientError,
|
|
9
8
|
ClientResponseError,
|
|
10
9
|
ClientSession,
|
|
11
10
|
ClientTimeout,
|
|
11
|
+
encode_basic_auth,
|
|
12
12
|
)
|
|
13
13
|
from prometheus_client.parser import text_string_to_metric_families
|
|
14
14
|
from yarl import URL
|
|
@@ -56,7 +56,9 @@ class UptimeKuma:
|
|
|
56
56
|
"""
|
|
57
57
|
self._base_url = base_url if isinstance(base_url, URL) else URL(base_url)
|
|
58
58
|
|
|
59
|
-
self.
|
|
59
|
+
self._headers = (
|
|
60
|
+
{"Authorization": encode_basic_auth("", api_key)} if api_key else None
|
|
61
|
+
)
|
|
60
62
|
|
|
61
63
|
self._timeout = ClientTimeout(total=timeout or 10)
|
|
62
64
|
self._session = session
|
|
@@ -89,7 +91,7 @@ class UptimeKuma:
|
|
|
89
91
|
|
|
90
92
|
try:
|
|
91
93
|
request = await self._session.get(
|
|
92
|
-
url,
|
|
94
|
+
url, headers=self._headers, timeout=self._timeout
|
|
93
95
|
)
|
|
94
96
|
request.raise_for_status()
|
|
95
97
|
except ClientResponseError as e:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|