oe-python-template-example 0.2.4__py3-none-any.whl → 0.2.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oe-python-template-example
3
- Version: 0.2.4
3
+ Version: 0.2.6
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/
@@ -104,48 +104,126 @@ Description-Content-Type: text/markdown
104
104
  ---
105
105
 
106
106
 
107
- Example project scaffolded and kept up to date with OE Python Template
108
- (oe-python-template).
107
+ Example project scaffolded and kept up to date with OE Python Template (oe-python-template).
108
+
109
+ This [Copier](https://copier.readthedocs.io/en/stable/) template enables you to quickly generate a Python package with fully functioning build and test automation.
110
+ Projects generated from this template can be [easily updated](https://copier.readthedocs.io/en/stable/updating/) to benefit from improvements and new features of the template.
111
+
112
+ Features:
113
+ 1. Package management with [uv](https://github.com/astral-sh/uv)
114
+ 2. Code formatting with [Ruff](https://github.com/astral-sh/ruff)
115
+ 3. Linting with [Ruff](https://github.com/astral-sh/ruff)
116
+ 4. Static type checking with [mypy](https://mypy.readthedocs.io/en/stable/)
117
+ 5. Complete set of [pre-commit](https://pre-commit.com/) hooks including [detect-secrets](https://github.com/Yelp/detect-secrets) and [pygrep](https://github.com/pre-commit/pygrep-hooks)
118
+ 6. Unit and E2E testing with [pytest](https://docs.pytest.org/en/stable/) including parallel test execution
119
+ 7. Matrix testing in multiple environments with [nox](https://nox.thea.codes/en/stable/)
120
+ 8. Test coverage reported with [Codecov](https://codecov.io/) and published as release artifact
121
+ 9. CI/CD pipeline automated with [GitHub Actions](https://github.com/features/actions)
122
+ 10. CI/CD pipeline can be run locally with [act](https://github.com/nektos/act)
123
+ 11. Code quality and security checks with [SonarQube](https://www.sonarsource.com/products/sonarcloud) and [GitHub CodeQL](https://codeql.github.com/)
124
+ 12. Dependency monitoring with [pip-audit](https://pypi.org/project/pip-audit/), [Renovate](https://github.com/renovatebot/renovate), and [GitHub Dependabot](https://docs.github.com/en/code-security/getting-started/dependabot-quickstart-guide)
125
+ 13. Licenses of dependencies extracted with [pip-licenses](https://pypi.org/project/pip-licenses/) and published as release artifacts in CSV and JSON format for compliance checks
126
+ 14. Software Bill of Materials (SBOM) generated with [cyclonedx-python](https://github.com/CycloneDX/cyclonedx-python) and published as release artifact
127
+ 15. Version and release management with [bump-my-version](https://callowayproject.github.io/bump-my-version/)
128
+ 16. Changelog and release notes generated with [git-cliff](https://git-cliff.org/)
129
+ 17. Documentation generated with [Sphinx](https://www.sphinx-doc.org/en/master/) including reference documentation and PDF export
130
+ 18. Documentation published to [Read The Docs](https://readthedocs.org/)
131
+ 19. Interactive OpenAPI specification with [Swagger](https://swagger.io/)
132
+ 20. Python package published to [PyPI](https://pypi.org/)
133
+ 21. Docker images published to [Docker.io](https://hub.docker.com/) and [GitHub Container Registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry) with [artifact attestations](https://docs.github.com/en/actions/security-for-github-actions/using-artifact-attestations/using-artifact-attestations-to-establish-provenance-for-builds)
134
+ 22. One-click development environments with [Dev Containers](https://code.visualstudio.com/docs/devcontainers/containers) and [GitHub Codespaces](https://github.com/features/codespaces)
135
+ 23. Settings for use with [VSCode](https://code.visualstudio.com/)
136
+ 24. Settings and custom instructions for use with [GitHub Copilot](https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot)
137
+
138
+ The generated project includes code, documentation and configuration of a fully functioning demo-application and service, which can be used as a starting point for your own project.
139
+ 1. Service architecture suitable for use as shared library
140
+ 2. Validation with [pydantic](https://docs.pydantic.dev/)
141
+ 3. Command-line interface (CLI) with [Typer](https://typer.tiangolo.com/)
142
+ 4. Versioned Web API with [FastAPI](https://fastapi.tiangolo.com/)
143
+ 5. [Interactive Jupyter notebook](https://jupyter.org/) and [reactive Marimo notebook](https://marimo.io/)
144
+ 6. Simple Web UI with [Streamlit](https://streamlit.io/)
145
+ 7. Configuration to run the CLI and API in a Docker container including setup for [Docker Compose](https://docs.docker.com/get-started/docker-concepts/the-basics/what-is-docker-compose/)
146
+ 8. Documentation including badges, setup instructions, contribution guide and security policy
147
+
148
+ Explore [here](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example) for what's generated out of the box.
149
+
150
+ ## Generate a new project
151
+
152
+ This template is designed to be used with the [copier](https://copier.readthedocs.io/en/stable/) project generator. It allows you to create a new project based on this template and customize it according to your needs.
153
+ To generate a new project, follow these steps:
154
+
155
+ **Step 1**: Install uv package manager and copier. Copy the following code into your terminal and execute it.
156
+ ```shell
157
+ if [[ "$OSTYPE" == "darwin"* ]]; then # Install dependencies for macOS X
158
+ if ! command -v brew &> /dev/null; then ## Install Homebrew if not present
159
+ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
160
+ fi
161
+ elif [[ "$OSTYPE" == "linux-gnu"* ]]; then # Install dependencies for Linux
162
+ sudo apt-get update -y && sudo apt-get install curl -y # Install curl
163
+ fi
164
+ if ! command -v uvx &> /dev/null; then # Install uv package manager if not present
165
+ curl -LsSf https://astral.sh/uv/install.sh | sh
166
+ source $HOME/.local/bin/env
167
+ fi
168
+ uv tool install copier # Install copier as global tool
169
+ ```
170
+
171
+ **Step 2**: [Create an empty repository on GitHub](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-new-repository), clone to your local machine, and change into it's directory.
172
+
173
+ **Step 3**: Generate the project. Copy
174
+ ```shell
175
+ copier copy --trust gh:helmut-hoffer-von-ankershoffen/oe-python-template .
176
+ ```
177
+
178
+ **Step 4**: Perform initial commit and push. Copy the following code into your terminal and execute it.
179
+ ```shell
180
+ git add .
181
+ git commit -m "feat: Initial commit"
182
+ git push
183
+ ```
184
+
185
+ Visit your GitHub repository and check the Actions tab. The CI workflow should already be running! The workflow will fail at the SonarQube step, as this external service is not yet configured for our new repository.
109
186
 
110
- Use Cases:
187
+ **Step 5**: Follow the [instructions](SERVICE_CONNECTIONS.md) to wire up
188
+ external services such as CloudCov, SonarQube Cloud, Read The Docs, Docker.io, and Streamlit Community Cloud.
111
189
 
112
- 1. Dummy CLI application and service demonstrating example usage of the
113
- directory structure and build pipeline generated by oe-python-template
190
+ **Step 6**: Release the first versions
191
+ ```shell
192
+ ./n bump
193
+ ```
194
+ Notes:
195
+ 1. You can remove this section post having successfully generated your project.
196
+ 2. The following sections refer to the dummy application and service provided by this template.
197
+ Use them as inspiration and adapt them to your own project.
114
198
 
115
199
  ## Overview
116
200
 
117
- Adding OE Python Template Example to your project as a dependency is easy.
201
+ Adding OE Python Template Example to your project as a dependency is easy. See below for usage examples.
118
202
 
119
203
  ```shell
120
204
  uv add oe-python-template-example # add dependency to your project
121
205
  ```
122
206
 
123
- If you don't have uv installed follow
124
- [these instructions](https://docs.astral.sh/uv/getting-started/installation/).
125
- If you still prefer pip over the modern and fast package manager
126
- [uv](https://github.com/astral-sh/uv), you can install the library like this:
207
+ If you don't have uv installed follow [these instructions](https://docs.astral.sh/uv/getting-started/installation/). If you still prefer pip over the modern and fast package manager [uv](https://github.com/astral-sh/uv), you can install the library like this:
208
+
127
209
 
128
210
  ```shell
129
211
  pip install oe-python-template-example # add dependency to your project
130
212
  ```
131
213
 
132
- Executing the command line interface (CLI) in an isolated Python environment is
133
- just as easy:
214
+ Executing the command line interface (CLI) in an isolated Python environment is just as easy:
134
215
 
135
216
  ```shell
136
- uvx oe-python-template-example hello-world # prints "Hello, world! [..]"
137
- uvx oe-python-template-example serve # serves webservice API
138
- uvx oe-python-template-example serve --port=4711 # serves webservice API on port 4711
217
+ uvx oe-python-template-example hello-world # prints "Hello, world! [..]"
218
+ uvx oe-python-template-example serve # serves web API
219
+ uvx oe-python-template-example serve --port=4711 # serves web API on port 4711
139
220
  ```
140
221
 
141
222
  Notes:
223
+ 1. The API is versioned, mounted at `/api/v1` resp. `/api/v2`
224
+ 2. While serving the web 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.
225
+ 3. Interactive documentation is provided at [http://127.0.0.1:8000/api/docs](http://127.0.0.1:8000/api/docs)
142
226
 
143
- - The API is versioned, mounted at `/api/v1` resp. `/api/v2`
144
- - While serving the webservice API go to
145
- [http://127.0.0.1:8000/api/v1/hello-world](http://127.0.0.1:8000/api/v1/hello-world)
146
- to see the respons of the `hello-world` operation.
147
- - Interactive documentation is provided at
148
- [http://127.0.0.1:8000/api/docs](http://127.0.0.1:8000/api/docs)
149
227
 
150
228
  The CLI provides extensive help:
151
229
 
@@ -157,48 +235,31 @@ uvx oe-python-template-example openapi --help
157
235
  uvx oe-python-template-example serve --help
158
236
  ```
159
237
 
238
+
160
239
  ## Operational Excellence
161
240
 
162
- This project is designed with operational excellence in mind, using modern
163
- Python tooling and practices. It includes:
164
-
165
- - Various examples demonstrating usage:
166
- - [Simple Python script](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/blob/main/examples/script.py)
167
- - [Streamlit web application](https://oe-python-template-example.streamlit.app/)
168
- deployed on [Streamlit Community Cloud](https://streamlit.io/cloud)
169
- - [Jupyter](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/blob/main/examples/notebook.ipynb)
170
- and
171
- [Marimo](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/blob/main/examples/notebook.py)
172
- notebook
173
- - [Complete reference documentation](https://oe-python-template-example.readthedocs.io/en/latest/reference.html)
174
- on Read the Docs
175
- - [Transparent test coverage](https://app.codecov.io/gh/helmut-hoffer-von-ankershoffen/oe-python-template-example)
176
- including unit and E2E tests (reported on Codecov)
177
- - Matrix tested with
178
- [multiple python versions](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/blob/main/noxfile.py)
179
- to ensure compatibility (powered by [Nox](https://nox.thea.codes/en/stable/))
180
- - Compliant with modern linting and formatting standards (powered by
181
- [Ruff](https://github.com/astral-sh/ruff))
182
- - Up-to-date dependencies (monitored by
183
- [Renovate](https://github.com/renovatebot/renovate) and
184
- [GitHub Dependabot](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/security/dependabot))
185
- - [A-grade code quality](https://sonarcloud.io/summary/new_code?id=helmut-hoffer-von-ankershoffen_oe-python-template-example)
186
- in security, maintainability, and reliability with low technical debt and
187
- codesmell (verified by SonarQube)
188
- - Additional code security checks using
189
- [GitHub CodeQL](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/security/code-scanning)
190
- - [Security Policy](SECURITY.md)
191
- - [License](LICENSE) compliant with the Open Source Initiative (OSI)
192
- - 1-liner for installation and execution of command line interface (CLI) via
193
- [uv(x)](https://github.com/astral-sh/uv) or
194
- [Docker](https://hub.docker.com/r/helmuthva/oe-python-template-example/tags)
195
- - Setup for developing inside a
196
- [devcontainer](https://code.visualstudio.com/docs/devcontainers/containers)
197
- included (supports VSCode and GitHub Codespaces)
241
+ This project is designed with operational excellence in mind, using modern Python tooling and practices. It includes:
242
+
243
+ 1. Various examples demonstrating usage:
244
+ a. [Simple Python script](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/blob/main/examples/script.py)
245
+ b. [Streamlit web application](https://oe-python-template-example.streamlit.app/) deployed on [Streamlit Community Cloud](https://streamlit.io/cloud)
246
+ c. [Jupyter](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/blob/main/examples/notebook.ipynb) and [Marimo](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/blob/main/examples/notebook.py) notebook
247
+ 2. [Complete reference documentation](https://oe-python-template-example.readthedocs.io/en/latest/reference.html) on Read the Docs
248
+ 3. [Transparent test coverage](https://app.codecov.io/gh/helmut-hoffer-von-ankershoffen/oe-python-template-example) including unit and E2E tests (reported on Codecov)
249
+ 4. Matrix tested with [multiple python versions](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/blob/main/noxfile.py) to ensure compatibility (powered by [Nox](https://nox.thea.codes/en/stable/))
250
+ 5. Compliant with modern linting and formatting standards (powered by [Ruff](https://github.com/astral-sh/ruff))
251
+ 6. Up-to-date dependencies (monitored by [Renovate](https://github.com/renovatebot/renovate) and [Dependabot](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/security/dependabot))
252
+ 7. [A-grade code quality](https://sonarcloud.io/summary/new_code?id=helmut-hoffer-von-ankershoffen_oe-python-template-example) in security, maintainability, and reliability with low technical debt and codesmell (verified by SonarQube)
253
+ 8. Additional code security checks using [CodeQL](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template-example/security/code-scanning)
254
+ 9. [Security Policy](SECURITY.md)
255
+ 10. [License](LICENSE) compliant with the Open Source Initiative (OSI)
256
+ 11. 1-liner for installation and execution of command line interface (CLI) via [uv(x)](https://github.com/astral-sh/uv) or [Docker](https://hub.docker.com/r/helmuthva/oe-python-template-example/tags)
257
+ 12. Setup for developing inside a [devcontainer](https://code.visualstudio.com/docs/devcontainers/containers) included (supports VSCode and GitHub Codespaces)
258
+
198
259
 
199
260
  ## Usage Examples
200
261
 
201
- The following examples run from source. Clone this repository first using
262
+ The following examples run from source - clone this repository using
202
263
  `git clone git@github.com:helmut-hoffer-von-ankershoffen/oe-python-template-example.git`.
203
264
 
204
265
  ### Minimal Python Script:
@@ -3,8 +3,8 @@ oe_python_template_example/api.py,sha256=tYX07MjjmDJWMvxciwFbtuaB5CyptItqR5NyMNO
3
3
  oe_python_template_example/cli.py,sha256=BHuDCrzYkvJYDdvk06KwkK_sKQx7h7hhRiO0peQMM1s,3474
4
4
  oe_python_template_example/constants.py,sha256=6uQHr2CRgzWQWhUQCRRKiPuFhzKB2iblZk3dIRQ5dDc,358
5
5
  oe_python_template_example/service.py,sha256=XlCrklSRy8_YaYvlVYiDFPUubHHm-J8BPx2f7_niGG4,760
6
- oe_python_template_example-0.2.4.dist-info/METADATA,sha256=6SGHy3UENC7GVmTiKnM_8Wjl1yTAUBEBRM80_kIVbqw,21183
7
- oe_python_template_example-0.2.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8
- oe_python_template_example-0.2.4.dist-info/entry_points.txt,sha256=S2eCPB45b1Wgj_GsDRFAN-e4h7dBA5UPxT8od98erDE,82
9
- oe_python_template_example-0.2.4.dist-info/licenses/LICENSE,sha256=5H409K6xzz9U5eUaoAHQExNkoWJRlU0LEj6wL2QJ34s,1113
10
- oe_python_template_example-0.2.4.dist-info/RECORD,,
6
+ oe_python_template_example-0.2.6.dist-info/METADATA,sha256=nOJWUtLAPPnB53d2urwkOWGdDoN38v6DWTGpbEZL7_Q,27715
7
+ oe_python_template_example-0.2.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
8
+ oe_python_template_example-0.2.6.dist-info/entry_points.txt,sha256=S2eCPB45b1Wgj_GsDRFAN-e4h7dBA5UPxT8od98erDE,82
9
+ oe_python_template_example-0.2.6.dist-info/licenses/LICENSE,sha256=5H409K6xzz9U5eUaoAHQExNkoWJRlU0LEj6wL2QJ34s,1113
10
+ oe_python_template_example-0.2.6.dist-info/RECORD,,