oe-python-template-example 0.1.0__tar.gz → 0.1.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.
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/.copier-answers.yml +1 -1
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/PKG-INFO +10 -8
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/README.md +9 -7
- oe_python_template_example-0.1.3/VERSION +1 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/_readme_header.md +4 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/_readme_main.md +5 -7
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/docs/source/conf.py +1 -1
- oe_python_template_example-0.1.3/examples/notebook.ipynb +46 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/pyproject.toml +6 -9
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/sonar-project.properties +1 -1
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/src/oe_python_template_example/api.py +11 -2
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/src/oe_python_template_example/cli.py +3 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/uv.lock +1 -1
- oe_python_template_example-0.1.0/VERSION +0 -1
- oe_python_template_example-0.1.0/examples/notebook.ipynb +0 -46
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/.act-env-public +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/.devcontainer/Dockerfile +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/.devcontainer/devcontainer.json +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/.devcontainer/onCreateCommand +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/.devcontainer/postAttachCommand +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/.devcontainer/postCreateCommand +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/.env.example +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/.github/workflows/docker-image-build-publish.yml +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/.github/workflows/package-build-publish-release.yml +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/.github/workflows/test-and-report.yml +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/.gitignore +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/.pre-commit-config.yaml +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/.python-version +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/.readthedocs.yml +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/.secrets.baseline +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/.vscode/extensions.json +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/.vscode/settings.json +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/CHANGELOG.md +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/CODEOWNERS +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/CONTRIBUTING.md +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/Dockerfile +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/LICENSE +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/RELEASE_NOTES.md +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/SERVICE_CONNECTIONS.md +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/_readme_footer.md +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/bin/git-cliff +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/bump +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/codecov.yml +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/compose.yaml +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/docs/Makefile +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/docs/make.bat +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/docs/source/_static/.keep +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/docs/source/_static/openapi.json +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/docs/source/_static/openapi.yaml +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/docs/source/_static/openapi_v1.json +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/docs/source/_static/openapi_v1.yaml +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/docs/source/_static/openapi_v2.json +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/docs/source/_static/openapi_v2.yaml +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/docs/source/api_v1.rst +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/docs/source/api_v2.rst +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/docs/source/contributing.rst +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/docs/source/index.rst +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/docs/source/latexmkrc +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/docs/source/main.rst +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/docs/source/reference.rst +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/docs/source/release-notes.rst +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/examples/__init__.py +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/examples/notebook.py +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/examples/script.py +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/examples/streamlit.py +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/git-cliff-2.7.0/CHANGELOG.md +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/git-cliff-2.7.0/LICENSE-APACHE +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/git-cliff-2.7.0/LICENSE-MIT +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/git-cliff-2.7.0/README.md +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/git-cliff-2.7.0/completions/_git-cliff +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/git-cliff-2.7.0/completions/_git-cliff.ps1 +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/git-cliff-2.7.0/completions/git-cliff.bash +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/git-cliff-2.7.0/completions/git-cliff.elv +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/git-cliff-2.7.0/completions/git-cliff.fish +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/git-cliff-2.7.0/git-cliff-completions +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/git-cliff-2.7.0/git-cliff-mangen +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/git-cliff-2.7.0/man/git-cliff.1 +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/git-cliff-2.7.0-x86_64-unknown-linux-gnu.tar.gz +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/github-action-run +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/latexmkrc +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/logo.png +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/noxfile.py +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/renovate.json +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/src/oe_python_template_example/__init__.py +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/src/oe_python_template_example/constants.py +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/src/oe_python_template_example/service.py +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/tests/__init__.py +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/tests/api_test.py +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/tests/cli_test.py +0 -0
- {oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/tests/fixtures/.keep +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: oe-python-template-example
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: 🧠 Example project scaffolded and kept up to date with OE Python Template (oe-python-template).
|
|
5
5
|
Project-URL: Homepage, https://oe-python-template-example.readthedocs.io/en/latest/
|
|
6
6
|
Project-URL: Documentation, https://oe-python-template-example.readthedocs.io/en/latest/
|
|
@@ -91,6 +91,10 @@ Description-Content-Type: text/markdown
|
|
|
91
91
|
|
|
92
92
|
> [!TIP]
|
|
93
93
|
> 📚 [Online documentation](https://oe-python-template-example.readthedocs.io/en/latest/) - 📖 [PDF Manual](https://oe-python-template-example.readthedocs.io/_/downloads/en/latest/pdf/)
|
|
94
|
+
|
|
95
|
+
> [!NOTE]
|
|
96
|
+
> 🧠 This project was scaffolded using the template [oe-python-template](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template) with [copier](https://copier.readthedocs.io/).
|
|
97
|
+
|
|
94
98
|
---
|
|
95
99
|
|
|
96
100
|
|
|
@@ -172,16 +176,14 @@ Executing the command line interface (CLI) in an isolated Python environment is
|
|
|
172
176
|
```shell
|
|
173
177
|
uvx oe-python-template-example hello-world # prints "Hello, world! [..]"
|
|
174
178
|
uvx oe-python-template-example serve # serves webservice API
|
|
179
|
+
uvx oe-python-template-example serve --port=4711 # serves webservice API on port 4711
|
|
175
180
|
```
|
|
176
181
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
```shell
|
|
182
|
+
Notes:
|
|
183
|
+
* The API is versioned, mounted at ```/api/v1``` resp. ```/api/v2```
|
|
184
|
+
* While serving the webservice API go to [http://127.0.0.1:8000/api/v1/hello-world](http://127.0.0.1:8000/api/v1/hello-world) to see the respons of the ```hello-world``` operation.
|
|
185
|
+
* Interactive documentation is provided at [http://127.0.0.1:8000/api/docs](http://127.0.0.1:8000/api/docs)
|
|
183
186
|
|
|
184
|
-
When running the webservice API, goto http://127.0.0.1:8000/api/v1/docs
|
|
185
187
|
|
|
186
188
|
The CLI provides extensive help:
|
|
187
189
|
|
|
@@ -30,6 +30,10 @@
|
|
|
30
30
|
|
|
31
31
|
> [!TIP]
|
|
32
32
|
> 📚 [Online documentation](https://oe-python-template-example.readthedocs.io/en/latest/) - 📖 [PDF Manual](https://oe-python-template-example.readthedocs.io/_/downloads/en/latest/pdf/)
|
|
33
|
+
|
|
34
|
+
> [!NOTE]
|
|
35
|
+
> 🧠 This project was scaffolded using the template [oe-python-template](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template) with [copier](https://copier.readthedocs.io/).
|
|
36
|
+
|
|
33
37
|
---
|
|
34
38
|
|
|
35
39
|
|
|
@@ -111,16 +115,14 @@ Executing the command line interface (CLI) in an isolated Python environment is
|
|
|
111
115
|
```shell
|
|
112
116
|
uvx oe-python-template-example hello-world # prints "Hello, world! [..]"
|
|
113
117
|
uvx oe-python-template-example serve # serves webservice API
|
|
118
|
+
uvx oe-python-template-example serve --port=4711 # serves webservice API on port 4711
|
|
114
119
|
```
|
|
115
120
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
```shell
|
|
121
|
+
Notes:
|
|
122
|
+
* The API is versioned, mounted at ```/api/v1``` resp. ```/api/v2```
|
|
123
|
+
* While serving the webservice API go to [http://127.0.0.1:8000/api/v1/hello-world](http://127.0.0.1:8000/api/v1/hello-world) to see the respons of the ```hello-world``` operation.
|
|
124
|
+
* Interactive documentation is provided at [http://127.0.0.1:8000/api/docs](http://127.0.0.1:8000/api/docs)
|
|
122
125
|
|
|
123
|
-
When running the webservice API, goto http://127.0.0.1:8000/api/v1/docs
|
|
124
126
|
|
|
125
127
|
The CLI provides extensive help:
|
|
126
128
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.1.3
|
|
@@ -30,4 +30,8 @@
|
|
|
30
30
|
|
|
31
31
|
> [!TIP]
|
|
32
32
|
> 📚 [Online documentation](https://oe-python-template-example.readthedocs.io/en/latest/) - 📖 [PDF Manual](https://oe-python-template-example.readthedocs.io/_/downloads/en/latest/pdf/)
|
|
33
|
+
|
|
34
|
+
> [!NOTE]
|
|
35
|
+
> 🧠 This project was scaffolded using the template [oe-python-template](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template) with [copier](https://copier.readthedocs.io/).
|
|
36
|
+
|
|
33
37
|
---
|
|
@@ -76,16 +76,14 @@ Executing the command line interface (CLI) in an isolated Python environment is
|
|
|
76
76
|
```shell
|
|
77
77
|
uvx oe-python-template-example hello-world # prints "Hello, world! [..]"
|
|
78
78
|
uvx oe-python-template-example serve # serves webservice API
|
|
79
|
+
uvx oe-python-template-example serve --port=4711 # serves webservice API on port 4711
|
|
79
80
|
```
|
|
80
81
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
```shell
|
|
82
|
+
Notes:
|
|
83
|
+
* The API is versioned, mounted at ```/api/v1``` resp. ```/api/v2```
|
|
84
|
+
* While serving the webservice API go to [http://127.0.0.1:8000/api/v1/hello-world](http://127.0.0.1:8000/api/v1/hello-world) to see the respons of the ```hello-world``` operation.
|
|
85
|
+
* Interactive documentation is provided at [http://127.0.0.1:8000/api/docs](http://127.0.0.1:8000/api/docs)
|
|
87
86
|
|
|
88
|
-
When running the webservice API, goto http://127.0.0.1:8000/api/v1/docs
|
|
89
87
|
|
|
90
88
|
The CLI provides extensive help:
|
|
91
89
|
|
|
@@ -26,7 +26,7 @@ extensions = [
|
|
|
26
26
|
project = "oe-python-template-example"
|
|
27
27
|
author = "Helmut Hoffer von Ankershoffen"
|
|
28
28
|
copyright = f" (c) 2025-{datetime.now(UTC).year}, {author}" # noqa: A001
|
|
29
|
-
version = "0.1.
|
|
29
|
+
version = "0.1.3"
|
|
30
30
|
release = version
|
|
31
31
|
github_username = "helmut-hoffer-von-ankershoffen"
|
|
32
32
|
github_repository = "oe-python-template-example"
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cells": [
|
|
3
|
+
{
|
|
4
|
+
"cell_type": "code",
|
|
5
|
+
"execution_count": 1,
|
|
6
|
+
"metadata": {},
|
|
7
|
+
"outputs": [
|
|
8
|
+
{
|
|
9
|
+
"name": "stdout",
|
|
10
|
+
"output_type": "stream",
|
|
11
|
+
"text": [
|
|
12
|
+
"Hello, world! The value of THE_VAR is not defined\n"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"source": [
|
|
17
|
+
"from oe_python_template import Service\n",
|
|
18
|
+
"\n",
|
|
19
|
+
"service = Service()\n",
|
|
20
|
+
"message = service.get_hello_world()\n",
|
|
21
|
+
"message"
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"metadata": {
|
|
26
|
+
"kernelspec": {
|
|
27
|
+
"display_name": ".venv",
|
|
28
|
+
"language": "python",
|
|
29
|
+
"name": "python3"
|
|
30
|
+
},
|
|
31
|
+
"language_info": {
|
|
32
|
+
"codemirror_mode": {
|
|
33
|
+
"name": "ipython",
|
|
34
|
+
"version": 3
|
|
35
|
+
},
|
|
36
|
+
"file_extension": ".py",
|
|
37
|
+
"mimetype": "text/x-python",
|
|
38
|
+
"name": "python",
|
|
39
|
+
"nbconvert_exporter": "python",
|
|
40
|
+
"pygments_lexer": "ipython3",
|
|
41
|
+
"version": "3.11.6"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"nbformat": 4,
|
|
45
|
+
"nbformat_minor": 2
|
|
46
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "oe-python-template-example"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.3"
|
|
4
4
|
description = "🧠 Example project scaffolded and kept up to date with OE Python Template (oe-python-template)."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [
|
|
@@ -134,10 +134,7 @@ target-version = "py311"
|
|
|
134
134
|
preview = true
|
|
135
135
|
fix = true
|
|
136
136
|
line-length = 120
|
|
137
|
-
extend-exclude = [
|
|
138
|
-
".fixme",
|
|
139
|
-
"notebook.py"
|
|
140
|
-
]
|
|
137
|
+
extend-exclude = [".fixme", "notebook.py"]
|
|
141
138
|
|
|
142
139
|
|
|
143
140
|
[tool.ruff.lint]
|
|
@@ -191,7 +188,7 @@ ignore = [
|
|
|
191
188
|
[tool.ruff.lint.extend-per-file-ignores]
|
|
192
189
|
"examples/notebook.py" = [
|
|
193
190
|
# we are more relaxed in notebooks, while sill applying hundreds of rules
|
|
194
|
-
"B018",
|
|
191
|
+
"B018", # notebooks surface variable without print
|
|
195
192
|
]
|
|
196
193
|
|
|
197
194
|
[tool.ruff.format]
|
|
@@ -200,7 +197,7 @@ docstring-code-format = true
|
|
|
200
197
|
[tool.ruff.lint.pydocstyle]
|
|
201
198
|
convention = "google"
|
|
202
199
|
|
|
203
|
-
[tool.mypy]
|
|
200
|
+
[tool.mypy] # https://mypy.readthedocs.io/en/latest/config_file.html
|
|
204
201
|
junit_xml = "mypi_junit.xml"
|
|
205
202
|
plugins = "pydantic.mypy"
|
|
206
203
|
strict = true
|
|
@@ -213,7 +210,7 @@ show_error_codes = true
|
|
|
213
210
|
show_error_context = true
|
|
214
211
|
warn_unreachable = true
|
|
215
212
|
|
|
216
|
-
[tool.pydantic-mypy]
|
|
213
|
+
[tool.pydantic-mypy] # https://docs.pydantic.dev/latest/integrations/mypy/#configuring-the-plugin
|
|
217
214
|
init_forbid_extra = true
|
|
218
215
|
init_typed = true
|
|
219
216
|
warn_required_dynamic_aliases = true
|
|
@@ -245,7 +242,7 @@ source = ["src/"]
|
|
|
245
242
|
|
|
246
243
|
|
|
247
244
|
[tool.bumpversion]
|
|
248
|
-
current_version = "0.1.
|
|
245
|
+
current_version = "0.1.3"
|
|
249
246
|
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
|
250
247
|
serialize = ["{major}.{minor}.{patch}"]
|
|
251
248
|
search = "{current_version}"
|
{oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/sonar-project.properties
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
sonar.projectKey=helmut-hoffer-von-ankershoffen_oe-python-template-example
|
|
2
2
|
sonar.organization=helmut-hoffer-von-ankershoffen
|
|
3
|
-
sonar.projectVersion=0.1.
|
|
3
|
+
sonar.projectVersion=0.1.3
|
|
4
4
|
sonar.projectDescription=🧠 Example project scaffolded and kept up to date with OE Python Template (oe-python-template).
|
|
5
5
|
sonar.links.homepage=https://oe-python-template-example.readthedocs.io/en/latest/
|
|
6
6
|
sonar.links.scm=https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example
|
|
@@ -8,6 +8,7 @@ This module provides a webservice API with several endpoints:
|
|
|
8
8
|
The endpoints use Pydantic models for request and response validation.
|
|
9
9
|
"""
|
|
10
10
|
|
|
11
|
+
import os
|
|
11
12
|
from collections.abc import Generator
|
|
12
13
|
from enum import StrEnum
|
|
13
14
|
from typing import Annotated
|
|
@@ -18,6 +19,8 @@ from pydantic import BaseModel, Field
|
|
|
18
19
|
from oe_python_template_example import Service
|
|
19
20
|
|
|
20
21
|
HELLO_WORLD_EXAMPLE = "Hello, world!"
|
|
22
|
+
UVICORN_HOST = os.environ.get("UVICORN_HOST", "127.0.0.1")
|
|
23
|
+
UVICORN_PORT = os.environ.get("UVICORN_PORT", "8000")
|
|
21
24
|
|
|
22
25
|
|
|
23
26
|
def get_service() -> Generator[Service, None, None]:
|
|
@@ -47,12 +50,18 @@ api = FastAPI(
|
|
|
47
50
|
{
|
|
48
51
|
"name": "v1",
|
|
49
52
|
"description": "API version 1, check link on the right",
|
|
50
|
-
"externalDocs": {
|
|
53
|
+
"externalDocs": {
|
|
54
|
+
"description": "sub-docs",
|
|
55
|
+
"url": f"http://{UVICORN_HOST}:{UVICORN_PORT}/api/v1/docs",
|
|
56
|
+
},
|
|
51
57
|
},
|
|
52
58
|
{
|
|
53
59
|
"name": "v2",
|
|
54
60
|
"description": "API version 2, check link on the right",
|
|
55
|
-
"externalDocs": {
|
|
61
|
+
"externalDocs": {
|
|
62
|
+
"description": "sub-docs",
|
|
63
|
+
"url": f"http://{UVICORN_HOST}:{UVICORN_PORT}/api/v2/docs",
|
|
64
|
+
},
|
|
56
65
|
},
|
|
57
66
|
],
|
|
58
67
|
)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""CLI (Command Line Interface) of OE Python Template Example."""
|
|
2
2
|
|
|
3
|
+
import os
|
|
3
4
|
from enum import StrEnum
|
|
4
5
|
from typing import Annotated
|
|
5
6
|
|
|
@@ -49,6 +50,8 @@ def serve(
|
|
|
49
50
|
) -> None:
|
|
50
51
|
"""Start the API server."""
|
|
51
52
|
console.print(f"Starting API server at http://{host}:{port}")
|
|
53
|
+
os.environ["UVICORN_HOST"] = host
|
|
54
|
+
os.environ["UVICORN_PORT"] = str(port)
|
|
52
55
|
uvicorn.run(
|
|
53
56
|
"oe_python_template_example.api:api",
|
|
54
57
|
host=host,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.1.0
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"cells": [
|
|
3
|
-
{
|
|
4
|
-
"cell_type": "code",
|
|
5
|
-
"execution_count": 1,
|
|
6
|
-
"metadata": {},
|
|
7
|
-
"outputs": [
|
|
8
|
-
{
|
|
9
|
-
"name": "stdout",
|
|
10
|
-
"output_type": "stream",
|
|
11
|
-
"text": [
|
|
12
|
-
"Hello, world! The value of THE_VAR is not defined\n"
|
|
13
|
-
]
|
|
14
|
-
}
|
|
15
|
-
],
|
|
16
|
-
"source": [
|
|
17
|
-
"from oe_python_template_example import Service\n",
|
|
18
|
-
"\n",
|
|
19
|
-
"service = Service()\n",
|
|
20
|
-
"message = service.get_hello_world()\n",
|
|
21
|
-
"message"
|
|
22
|
-
]
|
|
23
|
-
}
|
|
24
|
-
],
|
|
25
|
-
"metadata": {
|
|
26
|
-
"kernelspec": {
|
|
27
|
-
"display_name": ".venv",
|
|
28
|
-
"language": "python",
|
|
29
|
-
"name": "python3"
|
|
30
|
-
},
|
|
31
|
-
"language_info": {
|
|
32
|
-
"codemirror_mode": {
|
|
33
|
-
"name": "ipython",
|
|
34
|
-
"version": 3
|
|
35
|
-
},
|
|
36
|
-
"file_extension": ".py",
|
|
37
|
-
"mimetype": "text/x-python",
|
|
38
|
-
"name": "python",
|
|
39
|
-
"nbconvert_exporter": "python",
|
|
40
|
-
"pygments_lexer": "ipython3",
|
|
41
|
-
"version": "3.11.6"
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
"nbformat": 4,
|
|
45
|
-
"nbformat_minor": 2
|
|
46
|
-
}
|
|
File without changes
|
{oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/.devcontainer/Dockerfile
RENAMED
|
File without changes
|
|
File without changes
|
{oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/.devcontainer/onCreateCommand
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/.pre-commit-config.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/.vscode/extensions.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/SERVICE_CONNECTIONS.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/docs/source/_static/.keep
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/docs/source/api_v1.rst
RENAMED
|
File without changes
|
{oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/docs/source/api_v2.rst
RENAMED
|
File without changes
|
{oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/docs/source/contributing.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/docs/source/reference.rst
RENAMED
|
File without changes
|
{oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/docs/source/release-notes.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/git-cliff-2.7.0/CHANGELOG.md
RENAMED
|
File without changes
|
{oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/git-cliff-2.7.0/LICENSE-APACHE
RENAMED
|
File without changes
|
{oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/git-cliff-2.7.0/LICENSE-MIT
RENAMED
|
File without changes
|
{oe_python_template_example-0.1.0 → oe_python_template_example-0.1.3}/git-cliff-2.7.0/README.md
RENAMED
|
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
|