binnev-python-template 1.2.2__py3-none-any.whl → 5.3.0__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: binnev-python-template
3
- Version: 1.2.2
3
+ Version: 5.3.0
4
4
  Summary: Add your description here
5
5
  Author-email: Robin Neville <robin.m.neville@gmail.com>
6
6
  License-Expression: MIT
@@ -36,7 +36,7 @@ Requires-Dist: twine>=6.1.0; extra == "dev"
36
36
  # Python project template
37
37
  This project is a template for new python projects. It contains up-to-date tooling for tests, docs, versioning, and dependency management.
38
38
 
39
- In a nutshell, the idea is that you clone/fork this project, and then modify it to suit your new project. The [`docs/how-to/getting-started.md`](tutorials/getting-started.md) page provides a step-by-step guide.
39
+ In a nutshell, the idea is that you clone/fork this project, and then modify it to suit your new project. The [Getting Started](https://binnev.github.io/python-template/latest/tutorials/getting-started/) page provides a step-by-step guide.
40
40
 
41
41
  ## Documentation
42
42
  To view the documentation, run:
@@ -0,0 +1,15 @@
1
+ src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ src/api/__init__.py,sha256=sMZ_Q3pHNHBOBkJ3_K3VIH4de_UvfBsUnxfNKLgPnnU,28
3
+ src/api/app.py,sha256=pwmavYIVvWcucQ13Wf4V-iH4qy-2cr06XI2zfMZj_Pg,149
4
+ src/api/calculator.py,sha256=a5sJRHbznv91ldM3LtjFJBqaJ0O6w0HqyQ1If5Y_r68,1664
5
+ src/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ src/cli/calculator.py,sha256=Zc2o1ACWA6qhneGWnh6Y8Jyn6W0ifZEruJrU5drteOw,2284
7
+ src/cli/greeter.py,sha256=mh9Bzwa6B_vRBi6xZcXvAONAAYWMcSXhOYVnhEOO5T4,1157
8
+ src/core/__init__.py,sha256=jPUwX9NxOYxJ-G3jnlWF7_z5iis37as0BOIo1qxSO9I,55
9
+ src/core/calculator.py,sha256=rYsUuuAbmRnkdDjmZBFlTgOmIAexF332ELzWVQPoQw0,1790
10
+ src/core/greeter.py,sha256=lsfF9KhkYCcBW42MabmZMotiwD8cnj15ApBMr7tZWqI,226
11
+ binnev_python_template-5.3.0.dist-info/METADATA,sha256=STmQZ7YJZVFQvToo5p029oZvPPYDHnJZ9vQjfUmAtCQ,2531
12
+ binnev_python_template-5.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
13
+ binnev_python_template-5.3.0.dist-info/entry_points.txt,sha256=HKdmBrnYHfEJEmcrurGU7a3VXJ0_X9hp76jc4GhznXY,103
14
+ binnev_python_template-5.3.0.dist-info/top_level.txt,sha256=74rtVfumQlgAPzR5_2CgYN24MB0XARCg0t-gzk6gTrM,4
15
+ binnev_python_template-5.3.0.dist-info/RECORD,,
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ calculator = src.cli.calculator:calculator_app
3
+ greeter = src.cli.greeter:greeter_app
src/cli/__init__.py ADDED
File without changes
@@ -16,10 +16,10 @@ import typer
16
16
  from src import core
17
17
  from src.core import calculator
18
18
 
19
- app = typer.Typer()
19
+ calculator_app = typer.Typer()
20
20
 
21
21
 
22
- @app.command()
22
+ @calculator_app.command()
23
23
  def add(a: float, b: float) -> None:
24
24
  """
25
25
  Add two numbers.
@@ -32,7 +32,7 @@ def add(a: float, b: float) -> None:
32
32
  typer.echo(f"The result of addition is: {result}")
33
33
 
34
34
 
35
- @app.command()
35
+ @calculator_app.command()
36
36
  def subtract(a: float, b: float) -> None:
37
37
  """
38
38
  Subtract two numbers.
@@ -45,7 +45,7 @@ def subtract(a: float, b: float) -> None:
45
45
  typer.echo(f"The result of subtraction is: {result}")
46
46
 
47
47
 
48
- @app.command()
48
+ @calculator_app.command()
49
49
  def multiply(a: float, b: float) -> None:
50
50
  """
51
51
  Multiply two numbers.
@@ -58,7 +58,7 @@ def multiply(a: float, b: float) -> None:
58
58
  typer.echo(f"The result of multiplication is: {result}")
59
59
 
60
60
 
61
- @app.command()
61
+ @calculator_app.command()
62
62
  def divide(a: float, b: float) -> None:
63
63
  """
64
64
  Divide two numbers.
@@ -79,7 +79,7 @@ def _version_callback(value: bool) -> None:
79
79
  raise typer.Exit()
80
80
 
81
81
 
82
- @app.callback()
82
+ @calculator_app.callback()
83
83
  def main(
84
84
  version: Optional[bool] = typer.Option(
85
85
  None,
@@ -92,3 +92,7 @@ def main(
92
92
  ) -> None:
93
93
  """Handles the --version flag"""
94
94
  return
95
+
96
+
97
+ if __name__ == "__main__":
98
+ calculator_app()
src/cli/greeter.py ADDED
@@ -0,0 +1,57 @@
1
+ """
2
+ This module provides CLI commands for greeting people.
3
+
4
+ The module relies on the `core.greeter` module for the actual greeting logic.
5
+ """
6
+
7
+ from typing import Annotated, Optional
8
+
9
+ import typer
10
+
11
+ from src import core
12
+ from src.core import greeter
13
+
14
+ greeter_app = typer.Typer()
15
+
16
+
17
+ @greeter_app.command()
18
+ def greet(
19
+ name: Annotated[
20
+ str,
21
+ typer.Argument(help="The name of the person to greet."),
22
+ ] = "",
23
+ ) -> None:
24
+ """
25
+ Greet someone.
26
+
27
+ Args:
28
+ name: The name of the person to greet. If name is omitted, the world
29
+ will be greeted.
30
+ """
31
+ greeting = greeter.greeting(name)
32
+ typer.echo(greeting)
33
+
34
+
35
+ def _version_callback(value: bool) -> None:
36
+ if value:
37
+ typer.echo(f"{core.__app_name__} v{core.__version__}")
38
+ raise typer.Exit()
39
+
40
+
41
+ @greeter_app.callback()
42
+ def main(
43
+ version: Optional[bool] = typer.Option(
44
+ None,
45
+ "--version",
46
+ "-v",
47
+ help="Show the application's version and exit.",
48
+ callback=_version_callback,
49
+ is_eager=True,
50
+ ),
51
+ ) -> None:
52
+ """Handles the --version flag"""
53
+ return
54
+
55
+
56
+ if __name__ == "__main__":
57
+ greeter_app()
@@ -1,2 +1,2 @@
1
1
  __app_name__ = "python-template"
2
- __version__ = "1.2.2"
2
+ __version__ = "5.3.0"
src/core/greeter.py ADDED
@@ -0,0 +1,12 @@
1
+ def greeting(name: str = "") -> str:
2
+ """
3
+ Greet a person.
4
+
5
+ Args:
6
+ name: the name of the person to greet
7
+
8
+ Returns:
9
+ A greeting string
10
+ """
11
+ name = name or "world"
12
+ return f"Hello, {name}!"
@@ -1,13 +0,0 @@
1
- __init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- api/__init__.py,sha256=sMZ_Q3pHNHBOBkJ3_K3VIH4de_UvfBsUnxfNKLgPnnU,28
3
- api/app.py,sha256=pwmavYIVvWcucQ13Wf4V-iH4qy-2cr06XI2zfMZj_Pg,149
4
- api/calculator.py,sha256=a5sJRHbznv91ldM3LtjFJBqaJ0O6w0HqyQ1If5Y_r68,1664
5
- cli/__init__.py,sha256=JuQR1P36bOLj9DU5rMC_4OPRsj48OkFaBSPFTMjlUSc,35
6
- cli/__main__.py,sha256=yhh9JvWC840Ev_lWj3QovGBR2Tj6eUzgWYh0as1spLc,62
7
- cli/calculator.py,sha256=cvsrwMbizv8l4sDXjbaXogRBRr4d3DZEyXXtCLAK614,2168
8
- core/__init__.py,sha256=R3pyZpIhsGzw3M3SbELzxNis7FzslLTZwxjOrmowkdU,55
9
- core/calculator.py,sha256=rYsUuuAbmRnkdDjmZBFlTgOmIAexF332ELzWVQPoQw0,1790
10
- binnev_python_template-1.2.2.dist-info/METADATA,sha256=1RMu2CJLsWMBLSliLht8bfLhgAWugc00N0gxVizOyyI,2502
11
- binnev_python_template-1.2.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
- binnev_python_template-1.2.2.dist-info/top_level.txt,sha256=tnrNGeZWxGB7wuuBAehLylpPK3dJdsMjjMfpCEYgrxc,22
13
- binnev_python_template-1.2.2.dist-info/RECORD,,
@@ -1,4 +0,0 @@
1
- __init__
2
- api
3
- cli
4
- core
cli/__init__.py DELETED
@@ -1 +0,0 @@
1
- from .calculator import app as app
cli/__main__.py DELETED
@@ -1,4 +0,0 @@
1
- from src.cli import app
2
-
3
- if __name__ == "__main__":
4
- app()
File without changes
File without changes
{api → src/api}/app.py RENAMED
File without changes
File without changes
File without changes