oe-python-template-example 0.1.12__tar.gz → 0.1.13__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.12 → oe_python_template_example-0.1.13}/CHANGELOG.md +7 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/PKG-INFO +66 -85
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/README.md +65 -84
- oe_python_template_example-0.1.13/RELEASE_NOTES.md +8 -0
- oe_python_template_example-0.1.13/VERSION +1 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/_readme_main.md +65 -84
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/docs/source/_static/openapi_v1.yaml +16 -32
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/docs/source/_static/openapi_v2.yaml +16 -32
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/docs/source/conf.py +1 -1
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/pyproject.toml +2 -2
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/sonar-project.properties +1 -1
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/uv.lock +1 -1
- oe_python_template_example-0.1.12/RELEASE_NOTES.md +0 -1
- oe_python_template_example-0.1.12/VERSION +0 -1
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/.act-env-public +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/.copier-answers.yml +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/.devcontainer/Dockerfile +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/.devcontainer/devcontainer.json +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/.devcontainer/onCreateCommand +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/.devcontainer/postAttachCommand +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/.devcontainer/postCreateCommand +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/.env.example +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/.github/dependabot.yml +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/.github/workflows/codeql.yml +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/.github/workflows/docker-image-build-publish.yml +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/.github/workflows/package-build-publish-release.yml +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/.github/workflows/test-and-report.yml +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/.gitignore +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/.pre-commit-config.yaml +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/.python-version +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/.readthedocs.yml +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/.secrets.baseline +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/.vscode/extensions.json +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/.vscode/settings.json +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/CODEOWNERS +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/CONTRIBUTING.md +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/Dockerfile +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/LICENSE +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/SECURITY.md +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/SERVICE_CONNECTIONS.md +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/_readme_footer.md +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/_readme_header.md +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/bin/git-cliff +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/bump +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/codecov.yml +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/compose.yaml +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/docs/Makefile +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/docs/make.bat +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/docs/source/_static/.keep +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/docs/source/_static/openapi.json +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/docs/source/_static/openapi.yaml +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/docs/source/_static/openapi_v1.json +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/docs/source/_static/openapi_v2.json +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/docs/source/api_v1.rst +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/docs/source/api_v2.rst +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/docs/source/contributing.rst +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/docs/source/index.rst +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/docs/source/latexmkrc +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/docs/source/main.rst +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/docs/source/reference.rst +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/docs/source/release-notes.rst +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/examples/__init__.py +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/examples/notebook.ipynb +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/examples/notebook.py +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/examples/script.py +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/examples/streamlit.py +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/git-cliff-2.7.0/CHANGELOG.md +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/git-cliff-2.7.0/LICENSE-APACHE +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/git-cliff-2.7.0/LICENSE-MIT +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/git-cliff-2.7.0/README.md +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/git-cliff-2.7.0/completions/_git-cliff +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/git-cliff-2.7.0/completions/_git-cliff.ps1 +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/git-cliff-2.7.0/completions/git-cliff.bash +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/git-cliff-2.7.0/completions/git-cliff.elv +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/git-cliff-2.7.0/completions/git-cliff.fish +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/git-cliff-2.7.0/git-cliff-completions +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/git-cliff-2.7.0/git-cliff-mangen +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/git-cliff-2.7.0/man/git-cliff.1 +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/git-cliff-2.7.0-x86_64-unknown-linux-gnu.tar.gz +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/github-action-run +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/latexmkrc +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/logo.png +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/noxfile.py +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/renovate.json +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/src/oe_python_template_example/__init__.py +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/src/oe_python_template_example/api.py +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/src/oe_python_template_example/cli.py +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/src/oe_python_template_example/constants.py +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/src/oe_python_template_example/service.py +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/tests/__init__.py +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/tests/api_test.py +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/tests/cli_test.py +0 -0
- {oe_python_template_example-0.1.12 → oe_python_template_example-0.1.13}/tests/fixtures/.keep +0 -0
@@ -1,5 +1,12 @@
|
|
1
1
|
[🧠 OE Python Template Example](https://oe-python-template-example.readthedocs.io/en/latest/)
|
2
2
|
|
3
|
+
## [0.1.13](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/compare/v0.1.12..0.1.13) - 2025-03-14
|
4
|
+
|
5
|
+
### 📚 Documentation
|
6
|
+
|
7
|
+
- Adapt - ([6e99c1d](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/commit/6e99c1d604c8e9fe4094b6a21d95619181ea0d14))
|
8
|
+
|
9
|
+
|
3
10
|
## [0.1.7](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/compare/v0.1.6..v0.1.7) - 2025-03-14
|
4
11
|
|
5
12
|
### Deps
|
@@ -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.13
|
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/
|
@@ -100,64 +100,13 @@ Description-Content-Type: text/markdown
|
|
100
100
|
---
|
101
101
|
|
102
102
|
|
103
|
-
Example project scaffolded and kept up to date with OE Python Template
|
103
|
+
Example project scaffolded and kept up to date with OE Python Template
|
104
|
+
(oe-python-template).
|
104
105
|
|
105
106
|
Use Cases:
|
106
|
-
1) Fast and easy to use project setup
|
107
|
-
2) Consistent update of already scaffolded projects to benefit from new and improved features.
|
108
|
-
3) Dummy CLI application and service demonstrating example usage of the generated directory structure and build pipeline
|
109
107
|
|
110
|
-
|
111
|
-
|
112
|
-
**Step 1**: Install uv package manager and copier
|
113
|
-
```shell
|
114
|
-
if [[ "$OSTYPE" == "darwin"* ]]; then # Install dependencies for macOS X
|
115
|
-
if ! command -v brew &> /dev/null; then ## Install Homebrew if not present
|
116
|
-
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
117
|
-
fi
|
118
|
-
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then # Install dependencies for Linux
|
119
|
-
sudo apt-get update -y && sudo apt-get install curl -y # Install curl
|
120
|
-
fi
|
121
|
-
if ! command -v uvx &> /dev/null; then # Install uv package manager if not present
|
122
|
-
curl -LsSf https://astral.sh/uv/install.sh | sh
|
123
|
-
source $HOME/.local/bin/env
|
124
|
-
fi
|
125
|
-
uv tool install copier # Install copier as global tool
|
126
|
-
```
|
127
|
-
|
128
|
-
**Step 2**: Now create an empty repository on GitHubm, clone to your local machine, and change into it's directory.
|
129
|
-
|
130
|
-
**Step 3**: Scaffold the project
|
131
|
-
```shell
|
132
|
-
copier copy gh:helmut-hoffer-von-ankershoffen/oe-python-template .
|
133
|
-
```
|
134
|
-
**Step 4**: Setup the local environment
|
135
|
-
|
136
|
-
```shell
|
137
|
-
uv run nox -s setup_dev
|
138
|
-
```
|
139
|
-
|
140
|
-
**Step 5**: Perform initial commit and push
|
141
|
-
```shell
|
142
|
-
git add .
|
143
|
-
git commit -m "feat: Initial commit"
|
144
|
-
git push
|
145
|
-
```
|
146
|
-
|
147
|
-
Visit your GitHub repository and check the Actions tab. The CI workflow should fail at the SonarQube step,
|
148
|
-
as this external service is not yet configured for our new repository.
|
149
|
-
|
150
|
-
**Step 6**: Follow the [instructions](SERVICE_CONNECTIONS.md) to wire up
|
151
|
-
external services such as Cloudcov, SonarQube Cloud, Read The Docs, Docker.io, GHCR.io and Streamlit Community Cloud.
|
152
|
-
|
153
|
-
**Step 7**: Release the first versions
|
154
|
-
```shell
|
155
|
-
./bump
|
156
|
-
```
|
157
|
-
Notes:
|
158
|
-
* You can remove this section post having successfully scafolded your project.
|
159
|
-
* The following sections refer to the dummy application and service provided by this template.
|
160
|
-
Use them as inspiration and adapt them to your own project.
|
108
|
+
1. Dummy CLI application and service demonstrating example usage of the
|
109
|
+
directory structure and build pipeline generated by oe-python-template
|
161
110
|
|
162
111
|
## Overview
|
163
112
|
|
@@ -167,13 +116,17 @@ Adding OE Python Template Example to your project as a dependency is easy.
|
|
167
116
|
uv add oe-python-template-example # add dependency to your project
|
168
117
|
```
|
169
118
|
|
170
|
-
If you don't have uv installed follow
|
119
|
+
If you don't have uv installed follow
|
120
|
+
[these instructions](https://docs.astral.sh/uv/getting-started/installation/).
|
121
|
+
If you still prefer pip over the modern and fast package manager
|
122
|
+
[uv](https://github.com/astral-sh/uv), you can install the library like this:
|
171
123
|
|
172
124
|
```shell
|
173
125
|
pip install oe-python-template-example # add dependency to your project
|
174
126
|
```
|
175
127
|
|
176
|
-
Executing the command line interface (CLI) in an isolated Python environment is
|
128
|
+
Executing the command line interface (CLI) in an isolated Python environment is
|
129
|
+
just as easy:
|
177
130
|
|
178
131
|
```shell
|
179
132
|
uvx oe-python-template-example hello-world # prints "Hello, world! [..]"
|
@@ -182,10 +135,13 @@ uvx oe-python-template-example serve --port=4711 # serves webservice API on port
|
|
182
135
|
```
|
183
136
|
|
184
137
|
Notes:
|
185
|
-
* The API is versioned, mounted at ```/api/v1``` resp. ```/api/v2```
|
186
|
-
* 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.
|
187
|
-
* Interactive documentation is provided at [http://127.0.0.1:8000/api/docs](http://127.0.0.1:8000/api/docs)
|
188
138
|
|
139
|
+
- The API is versioned, mounted at `/api/v1` resp. `/api/v2`
|
140
|
+
- While serving the webservice API go to
|
141
|
+
[http://127.0.0.1:8000/api/v1/hello-world](http://127.0.0.1:8000/api/v1/hello-world)
|
142
|
+
to see the respons of the `hello-world` operation.
|
143
|
+
- Interactive documentation is provided at
|
144
|
+
[http://127.0.0.1:8000/api/docs](http://127.0.0.1:8000/api/docs)
|
189
145
|
|
190
146
|
The CLI provides extensive help:
|
191
147
|
|
@@ -197,27 +153,44 @@ uvx oe-python-template-example openapi --help
|
|
197
153
|
uvx oe-python-template-example serve --help
|
198
154
|
```
|
199
155
|
|
200
|
-
|
201
156
|
## Operational Excellence
|
202
157
|
|
203
|
-
This project is designed with operational excellence in mind, using modern
|
158
|
+
This project is designed with operational excellence in mind, using modern
|
159
|
+
Python tooling and practices. It includes:
|
204
160
|
|
205
|
-
|
161
|
+
- Various examples demonstrating usage:
|
206
162
|
- [Simple Python script](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/blob/main/examples/script.py)
|
207
|
-
- [Streamlit web application](https://oe-python-template-example.streamlit.app/)
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
163
|
+
- [Streamlit web application](https://oe-python-template-example.streamlit.app/)
|
164
|
+
deployed on [Streamlit Community Cloud](https://streamlit.io/cloud)
|
165
|
+
- [Jupyter](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/blob/main/examples/notebook.ipynb)
|
166
|
+
and
|
167
|
+
[Marimo](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/blob/main/examples/notebook.py)
|
168
|
+
notebook
|
169
|
+
- [Complete reference documentation](https://oe-python-template-example.readthedocs.io/en/latest/reference.html)
|
170
|
+
on Read the Docs
|
171
|
+
- [Transparent test coverage](https://app.codecov.io/gh/helmut-hoffer-von-ankershoffen/oe-python-template-example)
|
172
|
+
including unit and E2E tests (reported on Codecov)
|
173
|
+
- Matrix tested with
|
174
|
+
[multiple python versions](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/blob/main/noxfile.py)
|
175
|
+
to ensure compatibility (powered by [Nox](https://nox.thea.codes/en/stable/))
|
176
|
+
- Compliant with modern linting and formatting standards (powered by
|
177
|
+
[Ruff](https://github.com/astral-sh/ruff))
|
178
|
+
- Up-to-date dependencies (monitored by
|
179
|
+
[Renovate](https://github.com/renovatebot/renovate) and
|
180
|
+
[GitHub Dependabot](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/security/dependabot))
|
181
|
+
- [A-grade code quality](https://sonarcloud.io/summary/new_code?id=helmut-hoffer-von-ankershoffen_oe-python-template-example)
|
182
|
+
in security, maintainability, and reliability with low technical debt and
|
183
|
+
codesmell (verified by SonarQube)
|
184
|
+
- Additional code security checks using
|
185
|
+
[GitHub CodeQL](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/security/code-scanning)
|
186
|
+
- [Security Policy](SECURITY.md)
|
187
|
+
- [License](LICENSE) compliant with the Open Source Initiative (OSI)
|
188
|
+
- 1-liner for installation and execution of command line interface (CLI) via
|
189
|
+
[uv(x)](https://github.com/astral-sh/uv) or
|
190
|
+
[Docker](https://hub.docker.com/r/helmuthva/oe-python-template-example/tags)
|
191
|
+
- Setup for developing inside a
|
192
|
+
[devcontainer](https://code.visualstudio.com/docs/devcontainers/containers)
|
193
|
+
included (supports VSCode and GitHub Codespaces)
|
221
194
|
|
222
195
|
## Usage Examples
|
223
196
|
|
@@ -242,15 +215,19 @@ message = Service.get_hello_world()
|
|
242
215
|
console.print(f"[blue]{message}[/blue]")
|
243
216
|
```
|
244
217
|
|
245
|
-
[Show script code](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/blob/main/examples/script.py) -
|
218
|
+
[Show script code](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/blob/main/examples/script.py) -
|
219
|
+
[Read the reference documentation](https://oe-python-template-example.readthedocs.io/en/latest/reference.html)
|
246
220
|
|
247
221
|
### Streamlit App
|
248
222
|
|
249
|
-
Serve the functionality provided by OE Python Template Example in the web by
|
223
|
+
Serve the functionality provided by OE Python Template Example in the web by
|
224
|
+
easily integrating the service into a Streamlit application.
|
250
225
|
|
251
|
-
[Try it out!](https://oe-python-template-example.streamlit.app) -
|
226
|
+
[Try it out!](https://oe-python-template-example.streamlit.app) -
|
227
|
+
[Show the code](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/blob/main/examples/streamlit.py)
|
252
228
|
|
253
229
|
... or serve the app locally
|
230
|
+
|
254
231
|
```shell
|
255
232
|
uv sync --all-extras # Install streamlit dependency part of the examples extra, see pyproject.toml
|
256
233
|
uv run streamlit run examples/streamlit.py # Serve on localhost:8501, opens browser
|
@@ -267,7 +244,9 @@ uv run streamlit run examples/streamlit.py # Serve on localhost:8501, o
|
|
267
244
|
```shell
|
268
245
|
uv sync --all-extras # Install dependencies required for examples such as Juypyter kernel, see pyproject.toml
|
269
246
|
```
|
270
|
-
|
247
|
+
|
248
|
+
Install the
|
249
|
+
[Jupyter extension for VSCode](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter)
|
271
250
|
|
272
251
|
Click on `examples/notebook.ipynb` in VSCode and run it.
|
273
252
|
|
@@ -291,9 +270,11 @@ uv run marimo edit examples/notebook.py --watch # Edit on localhost:2718, op
|
|
291
270
|
|
292
271
|
... or edit interactively within VSCode
|
293
272
|
|
294
|
-
Install the
|
273
|
+
Install the
|
274
|
+
[Marimo extension for VSCode](https://marketplace.visualstudio.com/items?itemName=marimo-team.vscode-marimo)
|
295
275
|
|
296
|
-
Click on `examples/notebook.py` in VSCode and click on the caret next to the Run
|
276
|
+
Click on `examples/notebook.py` in VSCode and click on the caret next to the Run
|
277
|
+
icon above the code (looks like a pencil) > "Start in marimo editor" (edit).
|
297
278
|
|
298
279
|
## Command Line Interface (CLI)
|
299
280
|
|
@@ -370,7 +351,7 @@ curl http://127.0.0.1:8000/api/v2/docs
|
|
370
351
|
|
371
352
|
## Extra: Lorem Ipsum
|
372
353
|
|
373
|
-
|
354
|
+
Nothing yet
|
374
355
|
|
375
356
|
|
376
357
|
## Further Reading
|
@@ -39,64 +39,13 @@
|
|
39
39
|
---
|
40
40
|
|
41
41
|
|
42
|
-
Example project scaffolded and kept up to date with OE Python Template
|
42
|
+
Example project scaffolded and kept up to date with OE Python Template
|
43
|
+
(oe-python-template).
|
43
44
|
|
44
45
|
Use Cases:
|
45
|
-
1) Fast and easy to use project setup
|
46
|
-
2) Consistent update of already scaffolded projects to benefit from new and improved features.
|
47
|
-
3) Dummy CLI application and service demonstrating example usage of the generated directory structure and build pipeline
|
48
46
|
|
49
|
-
|
50
|
-
|
51
|
-
**Step 1**: Install uv package manager and copier
|
52
|
-
```shell
|
53
|
-
if [[ "$OSTYPE" == "darwin"* ]]; then # Install dependencies for macOS X
|
54
|
-
if ! command -v brew &> /dev/null; then ## Install Homebrew if not present
|
55
|
-
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
56
|
-
fi
|
57
|
-
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then # Install dependencies for Linux
|
58
|
-
sudo apt-get update -y && sudo apt-get install curl -y # Install curl
|
59
|
-
fi
|
60
|
-
if ! command -v uvx &> /dev/null; then # Install uv package manager if not present
|
61
|
-
curl -LsSf https://astral.sh/uv/install.sh | sh
|
62
|
-
source $HOME/.local/bin/env
|
63
|
-
fi
|
64
|
-
uv tool install copier # Install copier as global tool
|
65
|
-
```
|
66
|
-
|
67
|
-
**Step 2**: Now create an empty repository on GitHubm, clone to your local machine, and change into it's directory.
|
68
|
-
|
69
|
-
**Step 3**: Scaffold the project
|
70
|
-
```shell
|
71
|
-
copier copy gh:helmut-hoffer-von-ankershoffen/oe-python-template .
|
72
|
-
```
|
73
|
-
**Step 4**: Setup the local environment
|
74
|
-
|
75
|
-
```shell
|
76
|
-
uv run nox -s setup_dev
|
77
|
-
```
|
78
|
-
|
79
|
-
**Step 5**: Perform initial commit and push
|
80
|
-
```shell
|
81
|
-
git add .
|
82
|
-
git commit -m "feat: Initial commit"
|
83
|
-
git push
|
84
|
-
```
|
85
|
-
|
86
|
-
Visit your GitHub repository and check the Actions tab. The CI workflow should fail at the SonarQube step,
|
87
|
-
as this external service is not yet configured for our new repository.
|
88
|
-
|
89
|
-
**Step 6**: Follow the [instructions](SERVICE_CONNECTIONS.md) to wire up
|
90
|
-
external services such as Cloudcov, SonarQube Cloud, Read The Docs, Docker.io, GHCR.io and Streamlit Community Cloud.
|
91
|
-
|
92
|
-
**Step 7**: Release the first versions
|
93
|
-
```shell
|
94
|
-
./bump
|
95
|
-
```
|
96
|
-
Notes:
|
97
|
-
* You can remove this section post having successfully scafolded your project.
|
98
|
-
* The following sections refer to the dummy application and service provided by this template.
|
99
|
-
Use them as inspiration and adapt them to your own project.
|
47
|
+
1. Dummy CLI application and service demonstrating example usage of the
|
48
|
+
directory structure and build pipeline generated by oe-python-template
|
100
49
|
|
101
50
|
## Overview
|
102
51
|
|
@@ -106,13 +55,17 @@ Adding OE Python Template Example to your project as a dependency is easy.
|
|
106
55
|
uv add oe-python-template-example # add dependency to your project
|
107
56
|
```
|
108
57
|
|
109
|
-
If you don't have uv installed follow
|
58
|
+
If you don't have uv installed follow
|
59
|
+
[these instructions](https://docs.astral.sh/uv/getting-started/installation/).
|
60
|
+
If you still prefer pip over the modern and fast package manager
|
61
|
+
[uv](https://github.com/astral-sh/uv), you can install the library like this:
|
110
62
|
|
111
63
|
```shell
|
112
64
|
pip install oe-python-template-example # add dependency to your project
|
113
65
|
```
|
114
66
|
|
115
|
-
Executing the command line interface (CLI) in an isolated Python environment is
|
67
|
+
Executing the command line interface (CLI) in an isolated Python environment is
|
68
|
+
just as easy:
|
116
69
|
|
117
70
|
```shell
|
118
71
|
uvx oe-python-template-example hello-world # prints "Hello, world! [..]"
|
@@ -121,10 +74,13 @@ uvx oe-python-template-example serve --port=4711 # serves webservice API on port
|
|
121
74
|
```
|
122
75
|
|
123
76
|
Notes:
|
124
|
-
* The API is versioned, mounted at ```/api/v1``` resp. ```/api/v2```
|
125
|
-
* 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.
|
126
|
-
* Interactive documentation is provided at [http://127.0.0.1:8000/api/docs](http://127.0.0.1:8000/api/docs)
|
127
77
|
|
78
|
+
- The API is versioned, mounted at `/api/v1` resp. `/api/v2`
|
79
|
+
- While serving the webservice API go to
|
80
|
+
[http://127.0.0.1:8000/api/v1/hello-world](http://127.0.0.1:8000/api/v1/hello-world)
|
81
|
+
to see the respons of the `hello-world` operation.
|
82
|
+
- Interactive documentation is provided at
|
83
|
+
[http://127.0.0.1:8000/api/docs](http://127.0.0.1:8000/api/docs)
|
128
84
|
|
129
85
|
The CLI provides extensive help:
|
130
86
|
|
@@ -136,27 +92,44 @@ uvx oe-python-template-example openapi --help
|
|
136
92
|
uvx oe-python-template-example serve --help
|
137
93
|
```
|
138
94
|
|
139
|
-
|
140
95
|
## Operational Excellence
|
141
96
|
|
142
|
-
This project is designed with operational excellence in mind, using modern
|
97
|
+
This project is designed with operational excellence in mind, using modern
|
98
|
+
Python tooling and practices. It includes:
|
143
99
|
|
144
|
-
|
100
|
+
- Various examples demonstrating usage:
|
145
101
|
- [Simple Python script](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/blob/main/examples/script.py)
|
146
|
-
- [Streamlit web application](https://oe-python-template-example.streamlit.app/)
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
102
|
+
- [Streamlit web application](https://oe-python-template-example.streamlit.app/)
|
103
|
+
deployed on [Streamlit Community Cloud](https://streamlit.io/cloud)
|
104
|
+
- [Jupyter](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/blob/main/examples/notebook.ipynb)
|
105
|
+
and
|
106
|
+
[Marimo](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/blob/main/examples/notebook.py)
|
107
|
+
notebook
|
108
|
+
- [Complete reference documentation](https://oe-python-template-example.readthedocs.io/en/latest/reference.html)
|
109
|
+
on Read the Docs
|
110
|
+
- [Transparent test coverage](https://app.codecov.io/gh/helmut-hoffer-von-ankershoffen/oe-python-template-example)
|
111
|
+
including unit and E2E tests (reported on Codecov)
|
112
|
+
- Matrix tested with
|
113
|
+
[multiple python versions](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/blob/main/noxfile.py)
|
114
|
+
to ensure compatibility (powered by [Nox](https://nox.thea.codes/en/stable/))
|
115
|
+
- Compliant with modern linting and formatting standards (powered by
|
116
|
+
[Ruff](https://github.com/astral-sh/ruff))
|
117
|
+
- Up-to-date dependencies (monitored by
|
118
|
+
[Renovate](https://github.com/renovatebot/renovate) and
|
119
|
+
[GitHub Dependabot](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/security/dependabot))
|
120
|
+
- [A-grade code quality](https://sonarcloud.io/summary/new_code?id=helmut-hoffer-von-ankershoffen_oe-python-template-example)
|
121
|
+
in security, maintainability, and reliability with low technical debt and
|
122
|
+
codesmell (verified by SonarQube)
|
123
|
+
- Additional code security checks using
|
124
|
+
[GitHub CodeQL](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/security/code-scanning)
|
125
|
+
- [Security Policy](SECURITY.md)
|
126
|
+
- [License](LICENSE) compliant with the Open Source Initiative (OSI)
|
127
|
+
- 1-liner for installation and execution of command line interface (CLI) via
|
128
|
+
[uv(x)](https://github.com/astral-sh/uv) or
|
129
|
+
[Docker](https://hub.docker.com/r/helmuthva/oe-python-template-example/tags)
|
130
|
+
- Setup for developing inside a
|
131
|
+
[devcontainer](https://code.visualstudio.com/docs/devcontainers/containers)
|
132
|
+
included (supports VSCode and GitHub Codespaces)
|
160
133
|
|
161
134
|
## Usage Examples
|
162
135
|
|
@@ -181,15 +154,19 @@ message = Service.get_hello_world()
|
|
181
154
|
console.print(f"[blue]{message}[/blue]")
|
182
155
|
```
|
183
156
|
|
184
|
-
[Show script code](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/blob/main/examples/script.py) -
|
157
|
+
[Show script code](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/blob/main/examples/script.py) -
|
158
|
+
[Read the reference documentation](https://oe-python-template-example.readthedocs.io/en/latest/reference.html)
|
185
159
|
|
186
160
|
### Streamlit App
|
187
161
|
|
188
|
-
Serve the functionality provided by OE Python Template Example in the web by
|
162
|
+
Serve the functionality provided by OE Python Template Example in the web by
|
163
|
+
easily integrating the service into a Streamlit application.
|
189
164
|
|
190
|
-
[Try it out!](https://oe-python-template-example.streamlit.app) -
|
165
|
+
[Try it out!](https://oe-python-template-example.streamlit.app) -
|
166
|
+
[Show the code](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/blob/main/examples/streamlit.py)
|
191
167
|
|
192
168
|
... or serve the app locally
|
169
|
+
|
193
170
|
```shell
|
194
171
|
uv sync --all-extras # Install streamlit dependency part of the examples extra, see pyproject.toml
|
195
172
|
uv run streamlit run examples/streamlit.py # Serve on localhost:8501, opens browser
|
@@ -206,7 +183,9 @@ uv run streamlit run examples/streamlit.py # Serve on localhost:8501, o
|
|
206
183
|
```shell
|
207
184
|
uv sync --all-extras # Install dependencies required for examples such as Juypyter kernel, see pyproject.toml
|
208
185
|
```
|
209
|
-
|
186
|
+
|
187
|
+
Install the
|
188
|
+
[Jupyter extension for VSCode](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter)
|
210
189
|
|
211
190
|
Click on `examples/notebook.ipynb` in VSCode and run it.
|
212
191
|
|
@@ -230,9 +209,11 @@ uv run marimo edit examples/notebook.py --watch # Edit on localhost:2718, op
|
|
230
209
|
|
231
210
|
... or edit interactively within VSCode
|
232
211
|
|
233
|
-
Install the
|
212
|
+
Install the
|
213
|
+
[Marimo extension for VSCode](https://marketplace.visualstudio.com/items?itemName=marimo-team.vscode-marimo)
|
234
214
|
|
235
|
-
Click on `examples/notebook.py` in VSCode and click on the caret next to the Run
|
215
|
+
Click on `examples/notebook.py` in VSCode and click on the caret next to the Run
|
216
|
+
icon above the code (looks like a pencil) > "Start in marimo editor" (edit).
|
236
217
|
|
237
218
|
## Command Line Interface (CLI)
|
238
219
|
|
@@ -309,7 +290,7 @@ curl http://127.0.0.1:8000/api/v2/docs
|
|
309
290
|
|
310
291
|
## Extra: Lorem Ipsum
|
311
292
|
|
312
|
-
|
293
|
+
Nothing yet
|
313
294
|
|
314
295
|
|
315
296
|
## Further Reading
|
@@ -0,0 +1,8 @@
|
|
1
|
+
## [0.1.13](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/compare/v0.1.12..v0.1.13) - 2025-03-14
|
2
|
+
|
3
|
+
### 📚 Documentation
|
4
|
+
|
5
|
+
- Adapt - ([6e99c1d](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/commit/6e99c1d604c8e9fe4094b6a21d95619181ea0d14))
|
6
|
+
|
7
|
+
|
8
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
0.1.13
|