pyllo-greeting 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.
- pyllo_greeting/__init__.py +1 -0
- pyllo_greeting/commands/__init__.py +8 -0
- pyllo_greeting/commands/greet.py +19 -0
- pyllo_greeting/commands/meta.py +20 -0
- pyllo_greeting/main.py +9 -0
- pyllo_greeting/parser.py +36 -0
- pyllo_greeting-0.0.1.dist-info/METADATA +134 -0
- pyllo_greeting-0.0.1.dist-info/RECORD +12 -0
- pyllo_greeting-0.0.1.dist-info/WHEEL +5 -0
- pyllo_greeting-0.0.1.dist-info/entry_points.txt +2 -0
- pyllo_greeting-0.0.1.dist-info/licenses/LICENSE +21 -0
- pyllo_greeting-0.0.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.0.1"
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
def greet(
|
|
4
|
+
name: str = None,
|
|
5
|
+
tone: Literal["quick", "normal", "fancy"] = "normal"
|
|
6
|
+
) -> int:
|
|
7
|
+
if tone == "quick":
|
|
8
|
+
if name: print(f"Hi, {name}")
|
|
9
|
+
else: print("Hi")
|
|
10
|
+
|
|
11
|
+
elif tone == "fancy":
|
|
12
|
+
if name: print(f"Greetings. It is truly a pleasure to acknowledge your existence, {name}")
|
|
13
|
+
else: print("Greetings. It is truly a pleasure to acknowledge your existence")
|
|
14
|
+
|
|
15
|
+
else:
|
|
16
|
+
if name: print(f"Hello there, {name}")
|
|
17
|
+
else: print("Hello there")
|
|
18
|
+
|
|
19
|
+
return 0
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from importlib import metadata
|
|
2
|
+
|
|
3
|
+
def version():
|
|
4
|
+
"""Prints out the project's current version."""
|
|
5
|
+
print(metadata.version("pyllo_greeting"))
|
|
6
|
+
|
|
7
|
+
return 0
|
|
8
|
+
|
|
9
|
+
def credits():
|
|
10
|
+
"""Print's out the credits of the ones involved in the project."""
|
|
11
|
+
print("Project created by:")
|
|
12
|
+
print("\tJoão Antônio")
|
|
13
|
+
|
|
14
|
+
print("\nAuthor's GitHub:")
|
|
15
|
+
print("\thttps://github.com/joao-antonio-la")
|
|
16
|
+
|
|
17
|
+
print("\nProject's Repository:")
|
|
18
|
+
print("\thttps://github.com/joao-antonio-la/pyllo_greeting")
|
|
19
|
+
|
|
20
|
+
return 0
|
pyllo_greeting/main.py
ADDED
pyllo_greeting/parser.py
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from argparse import ArgumentParser
|
|
2
|
+
from pyllo_greeting.commands import credits, version
|
|
3
|
+
from pyllo_greeting.commands import greet
|
|
4
|
+
|
|
5
|
+
app_parser = ArgumentParser(
|
|
6
|
+
prog="pyllo",
|
|
7
|
+
description="A simple CLI tool to test Python distribution."
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
# Positional argument: name. Whatever the app will greet.
|
|
11
|
+
app_parser.add_argument("name", type=str, nargs="?", help="Name of the person to greet")
|
|
12
|
+
|
|
13
|
+
# Separate flags for tones
|
|
14
|
+
app_parser.add_argument("-q", "--quick", action="store_true", help="Greet with a quick tone")
|
|
15
|
+
app_parser.add_argument("-f", "--fancy", action="store_true", help="Greet with a fancy tone")
|
|
16
|
+
|
|
17
|
+
# Meta flags
|
|
18
|
+
app_parser.add_argument("-v", "--version", action="store_true", help="Show the app version")
|
|
19
|
+
app_parser.add_argument("-c", "--credits", action="store_true", help="Show project credits")
|
|
20
|
+
|
|
21
|
+
def run():
|
|
22
|
+
"""Command's execution based on user's inputs."""
|
|
23
|
+
args = app_parser.parse_args()
|
|
24
|
+
|
|
25
|
+
if args.version:
|
|
26
|
+
return version()
|
|
27
|
+
elif args.credits:
|
|
28
|
+
return credits()
|
|
29
|
+
|
|
30
|
+
tone = "normal"
|
|
31
|
+
if args.quick:
|
|
32
|
+
tone = "quick"
|
|
33
|
+
elif args.fancy:
|
|
34
|
+
tone = "fancy"
|
|
35
|
+
|
|
36
|
+
return greet(name=args.name, tone=tone)
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pyllo_greeting
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: CLI application for testing Python distribution methods
|
|
5
|
+
Author: João Antônio
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/joao-antonio-la/pyllo_greeting
|
|
8
|
+
Requires-Python: >=3.10
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Dynamic: license-file
|
|
12
|
+
|
|
13
|
+
# pyllo_greeting
|
|
14
|
+
|
|
15
|
+
Simple CLI application created for studying Python apps distribution methods.
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
> ⚠️ You must have python installed to use this application.
|
|
20
|
+
|
|
21
|
+
1. Clone the repository:
|
|
22
|
+
|
|
23
|
+
``` sh
|
|
24
|
+
git clone https://github.com/joao-antonio-la/pyllo_greeting.git
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
- After cloning the repo, you are ready to use the application.
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
With the application locally into your machine, you can use it by following the steps bellow:
|
|
32
|
+
|
|
33
|
+
1. Enter the project folder:
|
|
34
|
+
|
|
35
|
+
``` sh
|
|
36
|
+
cd pyllo_greeting
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
2. Create the virtual environment:
|
|
40
|
+
|
|
41
|
+
``` sh
|
|
42
|
+
python -m venv .venv # Windows
|
|
43
|
+
python3 -m venv .venv # MacOS and Linux
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
3. Activate the venv:
|
|
47
|
+
|
|
48
|
+
``` sh
|
|
49
|
+
.venv\Scripts\activate # Windows
|
|
50
|
+
source .venv/bin/activate # MacOS and Linux
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
4. Install the project locally:
|
|
54
|
+
|
|
55
|
+
``` sh
|
|
56
|
+
pip install .
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
5. Use the CLI:
|
|
60
|
+
|
|
61
|
+
``` sh
|
|
62
|
+
pyllo
|
|
63
|
+
# Output: Hello there
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Options
|
|
67
|
+
|
|
68
|
+
#### Name and Tones
|
|
69
|
+
|
|
70
|
+
- It is possible to pass a name/word to be greeted by the app:
|
|
71
|
+
|
|
72
|
+
``` sh
|
|
73
|
+
pyllo John
|
|
74
|
+
# Hello there, John
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
``` sh
|
|
78
|
+
pyllo everyone
|
|
79
|
+
# Hello there, everyone
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
- Secondly, there is also the possibity of informing a tone. The default tone is "normal":
|
|
83
|
+
|
|
84
|
+
1. `Normal/Default`:
|
|
85
|
+
|
|
86
|
+
``` sh
|
|
87
|
+
pyllo Alice
|
|
88
|
+
# Hello there, Alice
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
2. `Quick`:
|
|
92
|
+
|
|
93
|
+
``` sh
|
|
94
|
+
pyllo Theresa --quick
|
|
95
|
+
# Hi, Theresa
|
|
96
|
+
|
|
97
|
+
pyllo Matthew -q
|
|
98
|
+
# Hi, Matthew
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
3. `Fancy`:
|
|
102
|
+
|
|
103
|
+
``` sh
|
|
104
|
+
pyllo Leticia --fancy
|
|
105
|
+
# Greetings. It is truly a pleasure to acknowledge your existence, Leticia
|
|
106
|
+
|
|
107
|
+
pyllo Beatrice -f
|
|
108
|
+
# Greetings. It is truly a pleasure to acknowledge your existence, Beatrice
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
#### Meta Options
|
|
112
|
+
|
|
113
|
+
There are currently two `meta` options:
|
|
114
|
+
|
|
115
|
+
1. `App Version (--version | -v)`:
|
|
116
|
+
|
|
117
|
+
``` sh
|
|
118
|
+
pyllo -v
|
|
119
|
+
# 0.1.0
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
2. `App's Credits (--credits | -c)`:
|
|
123
|
+
|
|
124
|
+
``` sh
|
|
125
|
+
pyllo -c
|
|
126
|
+
# Project created by:
|
|
127
|
+
# João Antônio
|
|
128
|
+
|
|
129
|
+
# Author's GitHub:
|
|
130
|
+
# https://github.com/joao-antonio-la
|
|
131
|
+
|
|
132
|
+
# Project's Repository:
|
|
133
|
+
# https://github.com/joao-antonio-la/pyllo
|
|
134
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
pyllo_greeting/__init__.py,sha256=ugyuFliEqtAwQmH4sTlc16YXKYbFWDmfyk87fErB8-8,21
|
|
2
|
+
pyllo_greeting/main.py,sha256=oG42FGb3McW3ytxEuFB9RVE7olc4st-KwoNqHLtmDL4,158
|
|
3
|
+
pyllo_greeting/parser.py,sha256=yjZFwJqphpLqLu7eau3zM69VLmbGG3mnbQgDkvyl6aI,1205
|
|
4
|
+
pyllo_greeting/commands/__init__.py,sha256=TtDQgphd3Lz8xXQrPrXWFQ5Ix8KIlkJ_oy8A7pPbQhE,124
|
|
5
|
+
pyllo_greeting/commands/greet.py,sha256=PffRo1SjZBPNHxd8Azi5GhlK95l-pKZIoWaeqqURuCo,561
|
|
6
|
+
pyllo_greeting/commands/meta.py,sha256=WfNEkW-a5qb_kCu6tVx-Dcsv7VO_OKQiUzua4F3D0kA,531
|
|
7
|
+
pyllo_greeting-0.0.1.dist-info/licenses/LICENSE,sha256=ZfoWB0-4MTlkEeA9xUYTCienqA6uVwaWDCS86r6RZE0,1090
|
|
8
|
+
pyllo_greeting-0.0.1.dist-info/METADATA,sha256=YE5AaFczgtIbl97MQWMBk1HJWW-zoAPYWlVtZ3IU92U,2381
|
|
9
|
+
pyllo_greeting-0.0.1.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
10
|
+
pyllo_greeting-0.0.1.dist-info/entry_points.txt,sha256=W_FsYtMClFodzagTzyg0yNJu9ZdS9r_mCZSwMDzf_w0,51
|
|
11
|
+
pyllo_greeting-0.0.1.dist-info/top_level.txt,sha256=FIDF4hzd9CQdlEBq8Ae3z9Vbbwo7n5C1cvrbYKC7-yA,15
|
|
12
|
+
pyllo_greeting-0.0.1.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 João Antônio
|
|
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.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pyllo_greeting
|