oe-python-template-example 0.3.5__py3-none-any.whl → 0.3.6__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.
- oe_python_template_example/__init__.py +4 -18
- oe_python_template_example/api.py +42 -148
- oe_python_template_example/cli.py +13 -141
- oe_python_template_example/constants.py +6 -9
- oe_python_template_example/hello/__init__.py +17 -0
- oe_python_template_example/hello/_api.py +94 -0
- oe_python_template_example/hello/_cli.py +47 -0
- oe_python_template_example/hello/_constants.py +4 -0
- oe_python_template_example/hello/_models.py +28 -0
- oe_python_template_example/hello/_service.py +96 -0
- oe_python_template_example/{settings.py → hello/_settings.py} +6 -4
- oe_python_template_example/system/__init__.py +19 -0
- oe_python_template_example/system/_api.py +116 -0
- oe_python_template_example/system/_cli.py +165 -0
- oe_python_template_example/system/_service.py +182 -0
- oe_python_template_example/system/_settings.py +31 -0
- oe_python_template_example/utils/__init__.py +59 -0
- oe_python_template_example/utils/_api.py +18 -0
- oe_python_template_example/utils/_cli.py +68 -0
- oe_python_template_example/utils/_console.py +14 -0
- oe_python_template_example/utils/_constants.py +48 -0
- oe_python_template_example/utils/_di.py +70 -0
- oe_python_template_example/utils/_health.py +107 -0
- oe_python_template_example/utils/_log.py +122 -0
- oe_python_template_example/utils/_logfire.py +68 -0
- oe_python_template_example/utils/_process.py +41 -0
- oe_python_template_example/utils/_sentry.py +97 -0
- oe_python_template_example/utils/_service.py +39 -0
- oe_python_template_example/utils/_settings.py +80 -0
- oe_python_template_example/utils/boot.py +86 -0
- {oe_python_template_example-0.3.5.dist-info → oe_python_template_example-0.3.6.dist-info}/METADATA +77 -51
- oe_python_template_example-0.3.6.dist-info/RECORD +35 -0
- oe_python_template_example/models.py +0 -44
- oe_python_template_example/service.py +0 -68
- oe_python_template_example-0.3.5.dist-info/RECORD +0 -12
- {oe_python_template_example-0.3.5.dist-info → oe_python_template_example-0.3.6.dist-info}/WHEEL +0 -0
- {oe_python_template_example-0.3.5.dist-info → oe_python_template_example-0.3.6.dist-info}/entry_points.txt +0 -0
- {oe_python_template_example-0.3.5.dist-info → oe_python_template_example-0.3.6.dist-info}/licenses/LICENSE +0 -0
@@ -1,68 +0,0 @@
|
|
1
|
-
"""Service of OE Python Template Example."""
|
2
|
-
|
3
|
-
import os
|
4
|
-
|
5
|
-
from dotenv import load_dotenv
|
6
|
-
|
7
|
-
from .models import Echo, Utterance
|
8
|
-
from .settings import Language, Settings
|
9
|
-
|
10
|
-
load_dotenv()
|
11
|
-
THE_VAR = os.getenv("THE_VAR", "not defined")
|
12
|
-
|
13
|
-
|
14
|
-
class Service:
|
15
|
-
"""Service of OE Python Template Example."""
|
16
|
-
|
17
|
-
_settings: Settings
|
18
|
-
|
19
|
-
def __init__(self) -> None:
|
20
|
-
"""Initialize service."""
|
21
|
-
self._settings = Settings() # pyright: ignore[reportCallIssue] - false positive
|
22
|
-
self.is_healthy = True
|
23
|
-
|
24
|
-
def healthy(self) -> bool:
|
25
|
-
"""
|
26
|
-
Check if the service is healthy.
|
27
|
-
|
28
|
-
Returns:
|
29
|
-
bool: True if the service is healthy, False otherwise.
|
30
|
-
"""
|
31
|
-
return self.is_healthy
|
32
|
-
|
33
|
-
def info(self) -> str:
|
34
|
-
"""
|
35
|
-
Get info about configuration of service.
|
36
|
-
|
37
|
-
Returns:
|
38
|
-
str: Service configuration.
|
39
|
-
"""
|
40
|
-
return self._settings.model_dump_json()
|
41
|
-
|
42
|
-
def get_hello_world(self) -> str:
|
43
|
-
"""
|
44
|
-
Get a hello world message.
|
45
|
-
|
46
|
-
Returns:
|
47
|
-
str: Hello world message.
|
48
|
-
"""
|
49
|
-
match self._settings.language:
|
50
|
-
case Language.GERMAN:
|
51
|
-
return "Hallo, Welt!"
|
52
|
-
return "Hello, world!"
|
53
|
-
|
54
|
-
@staticmethod
|
55
|
-
def echo(utterance: Utterance) -> Echo:
|
56
|
-
"""
|
57
|
-
Loudly echo utterance.
|
58
|
-
|
59
|
-
Args:
|
60
|
-
utterance (Utterance): The utterance to echo.
|
61
|
-
|
62
|
-
Returns:
|
63
|
-
Echo: The loudly echoed utterance.
|
64
|
-
|
65
|
-
Raises:
|
66
|
-
ValueError: If the utterance is empty or contains only whitespace.
|
67
|
-
"""
|
68
|
-
return Echo(text=utterance.text.upper())
|
@@ -1,12 +0,0 @@
|
|
1
|
-
oe_python_template_example/__init__.py,sha256=Ks3KjkBuzEO1gaezabSfal_WVOsJbuweHwRCs58oRv4,435
|
2
|
-
oe_python_template_example/api.py,sha256=jP3nVgU06OHK0F9oi3h5_xZRWYsAu2fF80ezGshLk70,5034
|
3
|
-
oe_python_template_example/cli.py,sha256=g8qeEQ36wvXrFQba0L8aLiAs6wDcXfVnxcesEMiOQ3g,3894
|
4
|
-
oe_python_template_example/constants.py,sha256=6uQHr2CRgzWQWhUQCRRKiPuFhzKB2iblZk3dIRQ5dDc,358
|
5
|
-
oe_python_template_example/models.py,sha256=IbegPBFJq0OCAWS70V-ozl6coMd0dC2OsHZY-nIumGs,846
|
6
|
-
oe_python_template_example/service.py,sha256=WY7W6MG55cp0sfNVBWSkelXJcZ3dXIY5MQemUeQC-MA,1622
|
7
|
-
oe_python_template_example/settings.py,sha256=mQu7Bl2EhR6taQLqbaK1s86Ngn3kLVeEoMyhCqbydig,751
|
8
|
-
oe_python_template_example-0.3.5.dist-info/METADATA,sha256=nhqSJJjOcpe8dSBZCLAPrXLr6m9zZyR4fOIFSkDYQSk,30974
|
9
|
-
oe_python_template_example-0.3.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
10
|
-
oe_python_template_example-0.3.5.dist-info/entry_points.txt,sha256=S2eCPB45b1Wgj_GsDRFAN-e4h7dBA5UPxT8od98erDE,82
|
11
|
-
oe_python_template_example-0.3.5.dist-info/licenses/LICENSE,sha256=5H409K6xzz9U5eUaoAHQExNkoWJRlU0LEj6wL2QJ34s,1113
|
12
|
-
oe_python_template_example-0.3.5.dist-info/RECORD,,
|
{oe_python_template_example-0.3.5.dist-info → oe_python_template_example-0.3.6.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|
File without changes
|