oe-python-template 0.0.1__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.
@@ -0,0 +1,16 @@
1
+ """Copier template to scaffold Python projects compliant with best practices and modern tooling."""
2
+
3
+ from .constants import (
4
+ __project_name__,
5
+ __project_path__,
6
+ __version__,
7
+ )
8
+
9
+ from .service import Service
10
+
11
+ __all__ = [
12
+ "__project_name__",
13
+ "__project_path__",
14
+ "__version__",
15
+ "Service",
16
+ ]
@@ -0,0 +1,55 @@
1
+ """Command line interface of OE Python Template."""
2
+
3
+ from typing import Annotated
4
+
5
+ import typer
6
+ from rich.console import Console
7
+
8
+ from oe_python_template import __version__, Service
9
+
10
+ console = Console()
11
+
12
+ cli = typer.Typer(name="Command Line Interface of OE Python Template")
13
+
14
+
15
+ @cli.command()
16
+ def echo(
17
+ text: Annotated[
18
+ str, typer.Argument(help="The text to echo")
19
+ ] = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
20
+ json: Annotated[
21
+ bool,
22
+ typer.Option(
23
+ help=("Print as JSON"),
24
+ ),
25
+ ] = False,
26
+ ) -> None:
27
+ """Echo the text."""
28
+ if json:
29
+ console.print_json(data={"text": text})
30
+ else:
31
+ console.print(text)
32
+
33
+
34
+ @cli.command()
35
+ def hello_world() -> None:
36
+ """Print hello world message and what's in the environment variable THE_VAR."""
37
+ console.print(Service.get_hello_world())
38
+
39
+
40
+ def _apply_cli_settings(cli: typer.Typer, epilog: str) -> None:
41
+ """Add epilog to all typers in the tree and configure default behavior."""
42
+ cli.info.epilog = epilog
43
+ cli.info.no_args_is_help = True
44
+ for command in cli.registered_commands:
45
+ command.epilog = cli.info.epilog
46
+
47
+
48
+ _apply_cli_settings(
49
+ cli,
50
+ f"🧠 OE Python Template v{__version__} - built with love in Berlin 🐻",
51
+ )
52
+
53
+
54
+ if __name__ == "__main__":
55
+ cli()
@@ -0,0 +1,10 @@
1
+ """Constants used throughout OE Python Template's codebase ."""
2
+
3
+ import importlib.metadata
4
+ import pathlib
5
+
6
+ __project_name__ = __name__.split(".")[0]
7
+ __project_path__ = str(pathlib.Path(__file__).parent.parent.parent)
8
+ __version__ = importlib.metadata.version(__project_name__)
9
+
10
+ LOREM_IPSUM = "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
@@ -0,0 +1,25 @@
1
+ """Service of OE Python Template."""
2
+
3
+ import os
4
+
5
+ from dotenv import load_dotenv
6
+
7
+ load_dotenv()
8
+ THE_VAR = os.getenv("THE_VAR", "not defined")
9
+
10
+
11
+ class Service:
12
+ """Service of OE Python Template."""
13
+
14
+ def __init__(self) -> None:
15
+ """Initialize service."""
16
+
17
+ @staticmethod
18
+ def get_hello_world() -> str:
19
+ """
20
+ Get a hello world message.
21
+
22
+ Returns:
23
+ str: Hello world message.
24
+ """
25
+ return f"Hello, world! The value of THE_VAR is {THE_VAR}"
@@ -0,0 +1,225 @@
1
+ Metadata-Version: 2.4
2
+ Name: oe-python-template
3
+ Version: 0.0.1
4
+ Summary: 🧠 Copier template to scaffold Python projects compliant with best practices and modern tooling.
5
+ Project-URL: Homepage, https://oe-python-template.readthedocs.io/
6
+ Project-URL: Documentation, https://oe-python-template.readthedocs.io/
7
+ Project-URL: Source, https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template
8
+ Project-URL: Changelog, https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template/releases
9
+ Project-URL: Issues, https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template/issues
10
+ Author-email: Helmut Hoffer von Ankershoffen <helmuthva@gmail.com>
11
+ License: MIT License
12
+
13
+ Copyright (c) [2025] [Helmut Hoffer von Ankershoffen (helmuthva@gmail.com)]
14
+
15
+ Permission is hereby granted, free of charge, to any person obtaining a copy
16
+ of this software and associated documentation files (the "Software"), to deal
17
+ in the Software without restriction, including without limitation the rights
18
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19
+ copies of the Software, and to permit persons to whom the Software is
20
+ furnished to do so, subject to the following conditions:
21
+
22
+ The above copyright notice and this permission notice shall be included in all
23
+ copies or substantial portions of the Software.
24
+
25
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
+ SOFTWARE.
32
+ License-File: LICENSE
33
+ Keywords: codecov,docker,oe-python-template,pydantic,python,ruff,typer,uv
34
+ Classifier: Development Status :: 2 - Pre-Alpha
35
+ Classifier: Framework :: Pydantic
36
+ Classifier: Framework :: Pytest
37
+ Classifier: Intended Audience :: Developers
38
+ Classifier: Intended Audience :: End Users/Desktop
39
+ Classifier: License :: OSI Approved :: MIT License
40
+ Classifier: Natural Language :: English
41
+ Classifier: Operating System :: MacOS :: MacOS X
42
+ Classifier: Operating System :: Microsoft :: Windows
43
+ Classifier: Operating System :: POSIX :: Linux
44
+ Classifier: Programming Language :: Python
45
+ Classifier: Programming Language :: Python :: 3
46
+ Classifier: Programming Language :: Python :: 3.11
47
+ Classifier: Programming Language :: Python :: 3.12
48
+ Classifier: Programming Language :: Python :: 3.13
49
+ Classifier: Typing :: Typed
50
+ Requires-Python: <4.0,>=3.11
51
+ Requires-Dist: pydantic>=2.10.6
52
+ Requires-Dist: python-dotenv>=1.0.1
53
+ Requires-Dist: typer>=0.15.1
54
+ Provides-Extra: examples
55
+ Requires-Dist: jupyter>=1.1.1; extra == 'examples'
56
+ Requires-Dist: marimo>=0.11.13; extra == 'examples'
57
+ Requires-Dist: streamlit>=1.42.2; extra == 'examples'
58
+ Description-Content-Type: text/markdown
59
+
60
+ # 🧠 OE Python Template
61
+
62
+ [![License](https://img.shields.io/github/license/helmut-hoffer-von-ankershoffen/oe-python-template?logo=opensourceinitiative&logoColor=3DA639&labelColor=414042&color=A41831)
63
+ ](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template/blob/main/LICENSE)
64
+ [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/oe-python-template.svg?logo=python&color=204361&labelColor=1E2933)](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template/blob/main/noxfile.py)
65
+ [![CI](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template/actions/workflows/test-and-report.yml/badge.svg)](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template/actions/workflows/test-and-report.yml)
66
+ [![Read the Docs](https://img.shields.io/readthedocs/oe-python-template)](https://oe-python-template.readthedocs.io/)
67
+ [![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=helmut-hoffer-von-ankershoffen_oe-python-template&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=helmut-hoffer-von-ankershoffen_oe-python-template)
68
+ [![Security](https://sonarcloud.io/api/project_badges/measure?project=helmut-hoffer-von-ankershoffen_oe-python-template&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=helmut-hoffer-von-ankershoffen_oe-python-template)
69
+ [![Maintainability](https://sonarcloud.io/api/project_badges/measure?project=helmut-hoffer-von-ankershoffen_oe-python-template&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=helmut-hoffer-von-ankershoffen_oe-python-template)
70
+ [![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=helmut-hoffer-von-ankershoffen_oe-python-template&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=helmut-hoffer-von-ankershoffen_oe-python-template)
71
+ [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=helmut-hoffer-von-ankershoffen_oe-python-template&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=helmut-hoffer-von-ankershoffen_oe-python-template)
72
+ [![Coverage](https://codecov.io/gh/helmut-hoffer-von-ankershoffen/oe-python-template/graph/badge.svg?token=SX34YRP30E)](https://codecov.io/gh/helmut-hoffer-von-ankershoffen/oe-python-template)
73
+ [![Ruff](https://img.shields.io/badge/style-Ruff-blue?color=D6FF65)](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template/blob/main/noxfile.py)
74
+ [![GitHub - Version](https://img.shields.io/github/v/release/helmut-hoffer-von-ankershoffen/oe-python-template?label=GitHub&style=flat&labelColor=1C2C2E&color=blue&logo=GitHub&logoColor=white)](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template/releases)
75
+ [![GitHub - Commits](https://img.shields.io/github/commit-activity/m/helmut-hoffer-von-ankershoffen/oe-python-template/main?label=commits&style=flat&labelColor=1C2C2E&color=blue&logo=GitHub&logoColor=white)](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template/commits/main/)
76
+ [![PyPI - Version](https://img.shields.io/pypi/v/oe-python-template.svg?label=PyPI&logo=pypi&logoColor=%23FFD243&labelColor=%230073B7&color=FDFDFD)](https://pypi.python.org/pypi/oe-python-template)
77
+ [![PyPI - Status](https://img.shields.io/pypi/status/oe-python-template?logo=pypi&logoColor=%23FFD243&labelColor=%230073B7&color=FDFDFD)](https://pypi.python.org/pypi/oe-python-template)
78
+ [![Docker - Version](https://img.shields.io/docker/v/helmuthva/oe-python-template?sort=semver&label=Docker&logo=docker&logoColor=white&labelColor=1354D4&color=10151B)](https://hub.docker.com/r/helmuthva/oe-python-template/tags)
79
+ [![Docker - Size](https://img.shields.io/docker/image-size/helmuthva/oe-python-templatesort=semver&arch=arm64&label=image&logo=docker&logoColor=white&labelColor=1354D4&color=10151B)](https://hub.docker.com/r/helmuthva/oe-python-template/)
80
+ [![Copier](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-orange.json)](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template)
81
+ <!---
82
+ [![ghcr.io - Version](https://ghcr-badge.egpl.dev/helmut-hoffer-von-ankershoffen/oe-python-template/tags?color=%2344cc11&ignore=0.0%2C0%2Clatest&n=3&label=ghcr.io&trim=)](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template/pkgs/container/oe-python-template)
83
+ [![ghcr.io - Sze](https://ghcr-badge.egpl.dev/helmut-hoffer-von-ankershoffen/oe-python-template/size?color=%2344cc11&tag=latest&label=size&trim=)](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template/pkgs/container/oe-python-template)
84
+ -->
85
+
86
+ > [!TIP]
87
+ > 📚 [Online documentation](https://oe-python-template.readthedocs.io/en/latest/) - 📖 [PDF Manual](https://oe-python-template.readthedocs.io/_/downloads/en/latest/pdf/)
88
+ ---
89
+
90
+
91
+ Copier template to scaffold Python projects compliant with best practices and modern tooling.
92
+
93
+ Use Cases:
94
+ 1) Lorem Ipsum
95
+ 2) Dolor Sit Amet
96
+ 3) Consectetur Adipiscing Elit
97
+
98
+ ## Overview
99
+
100
+ Adding OE Python Template to your project as a dependency is easy.
101
+
102
+ ```shell
103
+ uv add oe-python-template # add dependency to your project
104
+ ```
105
+
106
+ 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:
107
+
108
+ ```shell
109
+ pip install oe-python-template # add dependency to your project
110
+ ```
111
+
112
+ Executing the command line interface (CLI) is just as easy:
113
+
114
+ ```shell
115
+ uvx oe-python-template
116
+ ```
117
+
118
+ The CLI provides extensive help:
119
+
120
+ ```shell
121
+ uvx oe-python-template --help # all CLI commands
122
+ uvx oe-python-template command --help # all options for command
123
+ ```
124
+
125
+ ## Highlights
126
+
127
+ * Copier template to scaffold Python projects compliant with best practices and modern tooling.
128
+ * Various Examples:
129
+ - [Streamlit web application](https://oe-python-template.streamlit.app/) deployed on [Streamlit Community Cloud](https://streamlit.io/cloud)
130
+ - [Jupyter notebook](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template/blob/main/examples/jupyter.ipynb)
131
+ - [Simple Python script]https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template/blob/main/examples/script.py)
132
+ * [Complete reference documenation](https://oe-python-template.readthedocs.io/en/latest/reference.html) on Read the Docs
133
+ * [Transparent test coverage](https://app.codecov.io/gh/helmut-hoffer-von-ankershoffen/oe-python-template) including unit and E2E tests (reported on Codecov)
134
+ * Matrix tested with [multiple python versions](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template/blob/main/noxfile.py) to ensure compatibility (powered by [Nox](https://nox.thea.codes/en/stable/))
135
+ * Compliant with modern linting and formatting standards (powered by [Ruff](https://github.com/astral-sh/ruff))
136
+ * Up-to-date dependencies (monitored by [Renovate](https://github.com/renovatebot/renovate))
137
+ * [A-grade code quality](https://sonarcloud.io/summary/new_code?id=helmut-hoffer-von-ankershoffen_oe-python-template) in security, maintainability, and reliability with low technical debt and low codesmell (verified by SonarQube)
138
+ * 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/tags)
139
+ * Setup for developing inside a [devcontainer](https://code.visualstudio.com/docs/devcontainers/containers) included (supports VSCode and GitHub Codespaces)
140
+
141
+ ## Usage Examples
142
+
143
+ ### Streamlit App
144
+
145
+ [Try it out!](https://oe-python-template.streamlit.app) - [Show the code](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template/blob/main/examples/streamlit.py)
146
+
147
+
148
+ ### Minimal Python Script:
149
+
150
+ ```python
151
+ """
152
+ Example script demonstrating the usage of OE Python Template.
153
+
154
+ """
155
+
156
+ print("Hello World")
157
+ ```
158
+
159
+ [Show script code](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template/blob/main/examples/script.py) - [Read the reference documentation](https://oe-python-template.readthedocs.io/en/latest/reference.html)
160
+
161
+ ## Jupyter Notebook
162
+
163
+ [Show notebook code](https://github.com/helmut-hoffer-von-ankershoffen/oe-python-template/blob/main/examples/jupyter.ipynb)
164
+
165
+ ## Command Line Interface (CLI)
166
+
167
+ ### Run with [uvx](https://docs.astral.sh/uv/guides/tools/)
168
+
169
+ Show available commands:
170
+
171
+ ```shell
172
+ uvx oe-python-template --help
173
+ ```
174
+
175
+ Execute command:
176
+
177
+ ```shell
178
+ uvx oe-python-template command "Lorem Ipsum"
179
+ ```
180
+
181
+ ### Run with Docker
182
+
183
+ Note: Replace ENV_KEY_TEST with Lorem Ipsum.
184
+
185
+ Show available commands:
186
+
187
+ ```bash
188
+ docker run helmuthva/oe-python-template --help
189
+ ```
190
+
191
+ Execute command:
192
+
193
+ ```bash
194
+ docker run --env ENV_KEY_TEST=ENV_VALUE_TEST helmuthva/oe-python-template command "Lorem Ipsum"
195
+ ```
196
+
197
+ Or use docker compose
198
+
199
+ File .env is passed through
200
+
201
+ ```bash
202
+ docker compose up
203
+ docker compose run oe-python-template --help
204
+ ```
205
+
206
+ ## Extra: Lorem Ipsum
207
+
208
+ Dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam.
209
+
210
+
211
+ ## Further Reading
212
+
213
+ * Check out the [reference](https://oe-python-template.readthedocs.io/en/latest/reference.html) with detailed documentation of public classes and functions.
214
+ * Our [release notes](https://oe-python-template.readthedocs.io/en/latest/release-notes.html) provide a complete log of recent improvements and changes.
215
+ * In case you want to help us improve 🧠 OE Python Template: The [contribution guidelines](https://oe-python-template.readthedocs.io/en/latest/contributing.html) explain how to setup your development environment and create pull requests.
216
+
217
+ ## Star History
218
+
219
+ <a href="https://star-history.com/#helmut-hoffer-von-ankershoffen/oe-python-template">
220
+ <picture>
221
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=helmut-hoffer-von-ankershoffen/oe-python-template&type=Date&theme=dark" />
222
+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=helmut-hoffer-von-ankershoffen/oe-python-template&type=Date" />
223
+ <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=helmut-hoffer-von-ankershoffen/oe-python-template&type=Date" />
224
+ </picture>
225
+ </a>
@@ -0,0 +1,9 @@
1
+ oe_python_template/__init__.py,sha256=Fnde1pSaMfYkaxltxJhP0d4G5o314EmKJThX08th754,316
2
+ oe_python_template/cli.py,sha256=JE64lWrsnUEZFLSIuehjDAScTJkBEKlqubaXjlJJcWU,1319
3
+ oe_python_template/constants.py,sha256=Z1c06l5DeRuFxYVLHihHHTYvr8_Qh0nyzVKOe5X3ZNs,350
4
+ oe_python_template/service.py,sha256=p59ch0g81LpsRvL-m-vLPuk0Rf6EYsZfZJ_OCA9vWzQ,500
5
+ oe_python_template-0.0.1.dist-info/METADATA,sha256=wp6J-oZzcSAkI-drBmoA4Dmr3Qs_PPIgJxpHqZi2bW8,13362
6
+ oe_python_template-0.0.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
7
+ oe_python_template-0.0.1.dist-info/entry_points.txt,sha256=IroSSWhLGxus9rxcashkYQda39TTvf7LbUMYtOKXUBE,66
8
+ oe_python_template-0.0.1.dist-info/licenses/LICENSE,sha256=5H409K6xzz9U5eUaoAHQExNkoWJRlU0LEj6wL2QJ34s,1113
9
+ oe_python_template-0.0.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.27.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ oe-python-template = oe_python_template.cli:cli
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) [2025] [Helmut Hoffer von Ankershoffen (helmuthva@gmail.com)]
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.