zenith-greeter 0.1.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.
- zenith_greeter/__init__.py +5 -0
- zenith_greeter/greeter.py +45 -0
- zenith_greeter-0.1.0.dist-info/METADATA +68 -0
- zenith_greeter-0.1.0.dist-info/RECORD +7 -0
- zenith_greeter-0.1.0.dist-info/WHEEL +5 -0
- zenith_greeter-0.1.0.dist-info/licenses/LICENSE +17 -0
- zenith_greeter-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""Greeting utilities for Python applications."""
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Greeter:
|
|
5
|
+
"""Build consistent greetings with optional custom wording.
|
|
6
|
+
|
|
7
|
+
Args:
|
|
8
|
+
name: Person to greet. Empty or whitespace-only names become ``"there"``.
|
|
9
|
+
greeting: Opening word or phrase, such as ``"Hello"`` or ``"Welcome"``.
|
|
10
|
+
welcome_message: Optional message appended after the greeting.
|
|
11
|
+
|
|
12
|
+
Example:
|
|
13
|
+
>>> Greeter("Awwal").greet()
|
|
14
|
+
'Hello, Awwal! Welcome to Python packages.'
|
|
15
|
+
>>> Greeter("Ada", greeting="Hi", welcome_message="Good to see you.").greet()
|
|
16
|
+
'Hi, Ada! Good to see you.'
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
def __init__(
|
|
20
|
+
self,
|
|
21
|
+
name: str = "there",
|
|
22
|
+
greeting: str = "Hello",
|
|
23
|
+
welcome_message: str = "Welcome to Python packages.",
|
|
24
|
+
) -> None:
|
|
25
|
+
if not isinstance(name, str):
|
|
26
|
+
raise TypeError("name must be a string")
|
|
27
|
+
if not isinstance(greeting, str):
|
|
28
|
+
raise TypeError("greeting must be a string")
|
|
29
|
+
if not isinstance(welcome_message, str):
|
|
30
|
+
raise TypeError("welcome_message must be a string")
|
|
31
|
+
|
|
32
|
+
greeting = greeting.strip()
|
|
33
|
+
if not greeting:
|
|
34
|
+
raise ValueError("greeting cannot be empty")
|
|
35
|
+
|
|
36
|
+
self.name = name.strip() or "there"
|
|
37
|
+
self.greeting = greeting
|
|
38
|
+
self.welcome_message = welcome_message.strip()
|
|
39
|
+
|
|
40
|
+
def greet(self) -> str:
|
|
41
|
+
"""Return the configured greeting as a string."""
|
|
42
|
+
message = f"{self.greeting}, {self.name}!"
|
|
43
|
+
if self.welcome_message:
|
|
44
|
+
message += f" {self.welcome_message}"
|
|
45
|
+
return message
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: zenith-greeter
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A small example Python package with a reusable Greeter class
|
|
5
|
+
Author: Zenith OX
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Keywords: greeting,example,zenith
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Dynamic: license-file
|
|
14
|
+
|
|
15
|
+
# Zenith Greeter
|
|
16
|
+
|
|
17
|
+
A small, dependency-free Python package demonstrating how to build, test, and publish a reusable class.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
After the package is published to PyPI:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
python -m pip install zenith-greeter
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
For local development from the project directory:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
python -m pip install -e .
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Quick start
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
from zenith_greeter import Greeter
|
|
37
|
+
|
|
38
|
+
person = Greeter("Awwal")
|
|
39
|
+
print(person.greet())
|
|
40
|
+
# Hello, Awwal! Welcome to Python packages.
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Customize the greeting
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
from zenith_greeter import Greeter
|
|
47
|
+
|
|
48
|
+
person = Greeter(
|
|
49
|
+
name="Ada",
|
|
50
|
+
greeting="Hi",
|
|
51
|
+
welcome_message="Good to see you.",
|
|
52
|
+
)
|
|
53
|
+
print(person.greet())
|
|
54
|
+
# Hi, Ada! Good to see you.
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
A missing or blank name defaults to `there`. The greeting phrase must not be blank. Set `welcome_message=""` to omit the final message. Non-string arguments raise `TypeError` rather than failing later in the program.
|
|
58
|
+
|
|
59
|
+
## Run the tests
|
|
60
|
+
|
|
61
|
+
From the project root, install the package in editable mode and run the tests:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
python -m pip install -e .
|
|
65
|
+
python -m unittest discover -s tests -v
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The package uses Python's built-in `unittest` framework and has no runtime dependencies.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
zenith_greeter/__init__.py,sha256=h_Psuqg6fPp5WEfeTeIEIsOBQImDh1D6EP5dR11hGMc,99
|
|
2
|
+
zenith_greeter/greeter.py,sha256=3DgG480RqVYbEGHTx9QSN3f29n0-rGVCxznVFRJvkkM,1624
|
|
3
|
+
zenith_greeter-0.1.0.dist-info/licenses/LICENSE,sha256=Qt9uuGW3WrjBxWe1f-yjg-xNoMxmHFitpTnDv3s0ndc,824
|
|
4
|
+
zenith_greeter-0.1.0.dist-info/METADATA,sha256=nkZC95ZkxTdmI7758oQtgvzikNeQ8_EWCDu0b6PAvWA,1664
|
|
5
|
+
zenith_greeter-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
6
|
+
zenith_greeter-0.1.0.dist-info/top_level.txt,sha256=e77hsRLWAKs7TvPgtwRFNI4fqaqltVcpDWiLI6Tnhlc,15
|
|
7
|
+
zenith_greeter-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Zenith OX
|
|
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.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
zenith_greeter
|