phi-hippo 0.1.0__tar.gz
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.
- phi_hippo-0.1.0/LICENSE +21 -0
- phi_hippo-0.1.0/PKG-INFO +93 -0
- phi_hippo-0.1.0/README.md +69 -0
- phi_hippo-0.1.0/pyproject.toml +37 -0
- phi_hippo-0.1.0/setup.cfg +4 -0
- phi_hippo-0.1.0/src/phi_hippo/__init__.py +12 -0
- phi_hippo-0.1.0/src/phi_hippo/cli.py +66 -0
- phi_hippo-0.1.0/src/phi_hippo/colors.py +42 -0
- phi_hippo-0.1.0/src/phi_hippo/greetings.py +131 -0
- phi_hippo-0.1.0/src/phi_hippo.egg-info/PKG-INFO +93 -0
- phi_hippo-0.1.0/src/phi_hippo.egg-info/SOURCES.txt +13 -0
- phi_hippo-0.1.0/src/phi_hippo.egg-info/dependency_links.txt +1 -0
- phi_hippo-0.1.0/src/phi_hippo.egg-info/entry_points.txt +2 -0
- phi_hippo-0.1.0/src/phi_hippo.egg-info/top_level.txt +1 -0
- phi_hippo-0.1.0/tests/test_greetings.py +102 -0
phi_hippo-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Your Name
|
|
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.
|
phi_hippo-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: phi_hippo
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A fun greeting utility — generate personalized greetings, motivational quotes, and ASCII banners!
|
|
5
|
+
Author-email: Your Name <your.email@example.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/yourusername/phi_hippo
|
|
8
|
+
Project-URL: Issues, https://github.com/yourusername/phi_hippo/issues
|
|
9
|
+
Keywords: greetings,fun,cli,utility,motivation
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Utilities
|
|
20
|
+
Requires-Python: >=3.8
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
|
|
25
|
+
# 🦛 phi_hippo
|
|
26
|
+
|
|
27
|
+
A fun Python package that generates personalized greetings, motivational quotes, and ASCII art banners!
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pip install phi_hippo
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
### Python API
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
from phi_hippo import greet, motivate, banner, colorize
|
|
41
|
+
|
|
42
|
+
# Generate a greeting
|
|
43
|
+
print(greet("Alice"))
|
|
44
|
+
# Hey Alice! 👋 Hope you're having an awesome day!
|
|
45
|
+
|
|
46
|
+
# Try different styles
|
|
47
|
+
print(greet("Bob", style="pirate"))
|
|
48
|
+
# Ahoy, Bob! 🏴☠️ Welcome aboard, ye scallywag!
|
|
49
|
+
|
|
50
|
+
# Get motivated
|
|
51
|
+
print(motivate())
|
|
52
|
+
# 🚀 You're capable of amazing things!
|
|
53
|
+
|
|
54
|
+
# Create a banner
|
|
55
|
+
print(banner("Hello World"))
|
|
56
|
+
# ==================================================
|
|
57
|
+
# = Hello World =
|
|
58
|
+
# ==================================================
|
|
59
|
+
|
|
60
|
+
# Add color to terminal output
|
|
61
|
+
print(colorize("Success!", "green", bold=True))
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Command Line
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Greet someone
|
|
68
|
+
phi_hippo hello Alice
|
|
69
|
+
phi_hippo hello Bob --style pirate --color cyan
|
|
70
|
+
|
|
71
|
+
# Get a motivational quote
|
|
72
|
+
phi_hippo motivate
|
|
73
|
+
|
|
74
|
+
# Create a banner
|
|
75
|
+
phi_hippo banner "My Project" --width 60 --char "*"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Available Greeting Styles
|
|
79
|
+
|
|
80
|
+
| Style | Example |
|
|
81
|
+
|----------------|------------------------------------------------------|
|
|
82
|
+
| `friendly` | Hey Alice! 👋 Hope you're having an awesome day! |
|
|
83
|
+
| `formal` | Good day, Alice. It is a pleasure to make your acquaintance. |
|
|
84
|
+
| `enthusiastic` | OMG Alice!!! 🎉🎉🎉 SO GREAT TO SEE YOU!!! |
|
|
85
|
+
| `pirate` | Ahoy, Alice! 🏴☠️ Welcome aboard, ye scallywag! |
|
|
86
|
+
|
|
87
|
+
## Available Colors
|
|
88
|
+
|
|
89
|
+
`red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
MIT License — see [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# 🦛 phi_hippo
|
|
2
|
+
|
|
3
|
+
A fun Python package that generates personalized greetings, motivational quotes, and ASCII art banners!
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install phi_hippo
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
### Python API
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
from phi_hippo import greet, motivate, banner, colorize
|
|
17
|
+
|
|
18
|
+
# Generate a greeting
|
|
19
|
+
print(greet("Alice"))
|
|
20
|
+
# Hey Alice! 👋 Hope you're having an awesome day!
|
|
21
|
+
|
|
22
|
+
# Try different styles
|
|
23
|
+
print(greet("Bob", style="pirate"))
|
|
24
|
+
# Ahoy, Bob! 🏴☠️ Welcome aboard, ye scallywag!
|
|
25
|
+
|
|
26
|
+
# Get motivated
|
|
27
|
+
print(motivate())
|
|
28
|
+
# 🚀 You're capable of amazing things!
|
|
29
|
+
|
|
30
|
+
# Create a banner
|
|
31
|
+
print(banner("Hello World"))
|
|
32
|
+
# ==================================================
|
|
33
|
+
# = Hello World =
|
|
34
|
+
# ==================================================
|
|
35
|
+
|
|
36
|
+
# Add color to terminal output
|
|
37
|
+
print(colorize("Success!", "green", bold=True))
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Command Line
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Greet someone
|
|
44
|
+
phi_hippo hello Alice
|
|
45
|
+
phi_hippo hello Bob --style pirate --color cyan
|
|
46
|
+
|
|
47
|
+
# Get a motivational quote
|
|
48
|
+
phi_hippo motivate
|
|
49
|
+
|
|
50
|
+
# Create a banner
|
|
51
|
+
phi_hippo banner "My Project" --width 60 --char "*"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Available Greeting Styles
|
|
55
|
+
|
|
56
|
+
| Style | Example |
|
|
57
|
+
|----------------|------------------------------------------------------|
|
|
58
|
+
| `friendly` | Hey Alice! 👋 Hope you're having an awesome day! |
|
|
59
|
+
| `formal` | Good day, Alice. It is a pleasure to make your acquaintance. |
|
|
60
|
+
| `enthusiastic` | OMG Alice!!! 🎉🎉🎉 SO GREAT TO SEE YOU!!! |
|
|
61
|
+
| `pirate` | Ahoy, Alice! 🏴☠️ Welcome aboard, ye scallywag! |
|
|
62
|
+
|
|
63
|
+
## Available Colors
|
|
64
|
+
|
|
65
|
+
`red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
MIT License — see [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "phi_hippo"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "A fun greeting utility — generate personalized greetings, motivational quotes, and ASCII banners!"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = {text = "MIT"}
|
|
11
|
+
requires-python = ">=3.8"
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Your Name", email = "your.email@example.com"},
|
|
14
|
+
]
|
|
15
|
+
keywords = ["greetings", "fun", "cli", "utility", "motivation"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 3 - Alpha",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"License :: OSI Approved :: MIT License",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.8",
|
|
22
|
+
"Programming Language :: Python :: 3.9",
|
|
23
|
+
"Programming Language :: Python :: 3.10",
|
|
24
|
+
"Programming Language :: Python :: 3.11",
|
|
25
|
+
"Programming Language :: Python :: 3.12",
|
|
26
|
+
"Topic :: Utilities",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[project.urls]
|
|
30
|
+
Homepage = "https://github.com/yourusername/phi_hippo"
|
|
31
|
+
Issues = "https://github.com/yourusername/phi_hippo/issues"
|
|
32
|
+
|
|
33
|
+
[project.scripts]
|
|
34
|
+
phi_hippo = "phi_hippo.cli:main"
|
|
35
|
+
|
|
36
|
+
[tool.setuptools.packages.find]
|
|
37
|
+
where = ["src"]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""
|
|
2
|
+
phi_hippo - A fun greeting utility package.
|
|
3
|
+
|
|
4
|
+
Generate personalized greetings, motivational quotes, and ASCII art banners.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from .greetings import greet, motivate, banner, random_greeting
|
|
8
|
+
from .colors import colorize
|
|
9
|
+
|
|
10
|
+
__version__ = "0.1.0"
|
|
11
|
+
__author__ = "Your Name"
|
|
12
|
+
__all__ = ["greet", "motivate", "banner", "random_greeting", "colorize"]
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"""Command-line interface for phi_hippo."""
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
from . import greet, motivate, banner, colorize, __version__
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def main():
|
|
8
|
+
"""Entry point for the phi_hippo CLI."""
|
|
9
|
+
parser = argparse.ArgumentParser(
|
|
10
|
+
prog="phi_hippo",
|
|
11
|
+
description="🎉 phi_hippo - Generate fun greetings from your terminal!",
|
|
12
|
+
)
|
|
13
|
+
parser.add_argument(
|
|
14
|
+
"-v", "--version", action="version", version=f"phi_hippo {__version__}"
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
subparsers = parser.add_subparsers(dest="command", help="Available commands")
|
|
18
|
+
|
|
19
|
+
# greet command
|
|
20
|
+
greet_parser = subparsers.add_parser("hello", help="Greet someone")
|
|
21
|
+
greet_parser.add_argument("name", help="Name of the person to greet")
|
|
22
|
+
greet_parser.add_argument(
|
|
23
|
+
"-s",
|
|
24
|
+
"--style",
|
|
25
|
+
choices=["friendly", "formal", "enthusiastic", "pirate"],
|
|
26
|
+
default="friendly",
|
|
27
|
+
help="Greeting style (default: friendly)",
|
|
28
|
+
)
|
|
29
|
+
greet_parser.add_argument(
|
|
30
|
+
"-c", "--color", default=None, help="Colorize the output"
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
# motivate command
|
|
34
|
+
subparsers.add_parser("motivate", help="Get a motivational quote")
|
|
35
|
+
|
|
36
|
+
# banner command
|
|
37
|
+
banner_parser = subparsers.add_parser("banner", help="Create an ASCII banner")
|
|
38
|
+
banner_parser.add_argument("text", help="Text for the banner")
|
|
39
|
+
banner_parser.add_argument(
|
|
40
|
+
"-w", "--width", type=int, default=50, help="Banner width (default: 50)"
|
|
41
|
+
)
|
|
42
|
+
banner_parser.add_argument(
|
|
43
|
+
"--char", default="=", help="Border character (default: =)"
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
args = parser.parse_args()
|
|
47
|
+
|
|
48
|
+
if args.command is None:
|
|
49
|
+
parser.print_help()
|
|
50
|
+
return
|
|
51
|
+
|
|
52
|
+
if args.command == "hello":
|
|
53
|
+
result = greet(args.name, args.style)
|
|
54
|
+
if args.color:
|
|
55
|
+
result = colorize(result, args.color)
|
|
56
|
+
print(result)
|
|
57
|
+
|
|
58
|
+
elif args.command == "motivate":
|
|
59
|
+
print(motivate())
|
|
60
|
+
|
|
61
|
+
elif args.command == "banner":
|
|
62
|
+
print(banner(args.text, char=args.char, width=args.width))
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
if __name__ == "__main__":
|
|
66
|
+
main()
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"""Terminal color utilities for greetify."""
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
# ANSI escape codes for terminal colors
|
|
5
|
+
COLORS = {
|
|
6
|
+
"red": "\033[91m",
|
|
7
|
+
"green": "\033[92m",
|
|
8
|
+
"yellow": "\033[93m",
|
|
9
|
+
"blue": "\033[94m",
|
|
10
|
+
"magenta": "\033[95m",
|
|
11
|
+
"cyan": "\033[96m",
|
|
12
|
+
"white": "\033[97m",
|
|
13
|
+
"reset": "\033[0m",
|
|
14
|
+
"bold": "\033[1m",
|
|
15
|
+
"dim": "\033[2m",
|
|
16
|
+
"underline": "\033[4m",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def colorize(text: str, color: str = "green", bold: bool = False) -> str:
|
|
21
|
+
"""
|
|
22
|
+
Add terminal color to text using ANSI escape codes.
|
|
23
|
+
|
|
24
|
+
Args:
|
|
25
|
+
text: The text to colorize.
|
|
26
|
+
color: The color name. Options: red, green, yellow, blue, magenta, cyan, white.
|
|
27
|
+
bold: If True, make the text bold.
|
|
28
|
+
|
|
29
|
+
Returns:
|
|
30
|
+
The text wrapped in ANSI color codes.
|
|
31
|
+
|
|
32
|
+
Example:
|
|
33
|
+
>>> from greetify import colorize
|
|
34
|
+
>>> print(colorize("Hello!", "cyan", bold=True))
|
|
35
|
+
"""
|
|
36
|
+
if color not in COLORS:
|
|
37
|
+
raise ValueError(
|
|
38
|
+
f"Unknown color '{color}'. Choose from: {', '.join(c for c in COLORS if c not in ('reset', 'bold', 'dim', 'underline'))}"
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
prefix = COLORS.get("bold", "") if bold else ""
|
|
42
|
+
return f"{prefix}{COLORS[color]}{text}{COLORS['reset']}"
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"""Core greeting functions for the greetify package."""
|
|
2
|
+
|
|
3
|
+
import random
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def greet(name: str, style: str = "friendly") -> str:
|
|
8
|
+
"""
|
|
9
|
+
Generate a personalized greeting.
|
|
10
|
+
|
|
11
|
+
Args:
|
|
12
|
+
name: The name of the person to greet.
|
|
13
|
+
style: The style of greeting. Options: 'friendly', 'formal', 'enthusiastic', 'pirate'.
|
|
14
|
+
|
|
15
|
+
Returns:
|
|
16
|
+
A greeting string.
|
|
17
|
+
|
|
18
|
+
Example:
|
|
19
|
+
>>> from greetify import greet
|
|
20
|
+
>>> greet("Alice")
|
|
21
|
+
'Hey Alice! 👋 Hope you're having an awesome day!'
|
|
22
|
+
"""
|
|
23
|
+
styles = {
|
|
24
|
+
"friendly": f"Hey {name}! 👋 Hope you're having an awesome day!",
|
|
25
|
+
"formal": f"Good day, {name}. It is a pleasure to make your acquaintance.",
|
|
26
|
+
"enthusiastic": f"OMG {name}!!! 🎉🎉🎉 SO GREAT TO SEE YOU!!!",
|
|
27
|
+
"pirate": f"Ahoy, {name}! 🏴☠️ Welcome aboard, ye scallywag!",
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if style not in styles:
|
|
31
|
+
raise ValueError(
|
|
32
|
+
f"Unknown style '{style}'. Choose from: {', '.join(styles.keys())}"
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
return styles[style]
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def random_greeting(name: str) -> str:
|
|
39
|
+
"""
|
|
40
|
+
Generate a random-style greeting.
|
|
41
|
+
|
|
42
|
+
Args:
|
|
43
|
+
name: The name of the person to greet.
|
|
44
|
+
|
|
45
|
+
Returns:
|
|
46
|
+
A randomly styled greeting string.
|
|
47
|
+
"""
|
|
48
|
+
style = random.choice(["friendly", "formal", "enthusiastic", "pirate"])
|
|
49
|
+
return greet(name, style)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def motivate() -> str:
|
|
53
|
+
"""
|
|
54
|
+
Get a random motivational quote.
|
|
55
|
+
|
|
56
|
+
Returns:
|
|
57
|
+
A motivational quote string.
|
|
58
|
+
|
|
59
|
+
Example:
|
|
60
|
+
>>> from greetify import motivate
|
|
61
|
+
>>> print(motivate())
|
|
62
|
+
"""
|
|
63
|
+
quotes = [
|
|
64
|
+
"🚀 You're capable of amazing things!",
|
|
65
|
+
"💪 Every expert was once a beginner. Keep going!",
|
|
66
|
+
"🌟 The only limit is the one you set yourself.",
|
|
67
|
+
"🔥 Code like nobody's watching, deploy like everybody is.",
|
|
68
|
+
"✨ Bugs are just features waiting to be understood.",
|
|
69
|
+
"🎯 One commit at a time, you'll build something incredible.",
|
|
70
|
+
"🧠 Your potential is infinite. Compile and run!",
|
|
71
|
+
"🌈 Every error message is a step closer to success.",
|
|
72
|
+
]
|
|
73
|
+
return random.choice(quotes)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def banner(text: str, char: str = "=", width: int = 50) -> str:
|
|
77
|
+
"""
|
|
78
|
+
Create an ASCII art banner around text.
|
|
79
|
+
|
|
80
|
+
Args:
|
|
81
|
+
text: The text to display in the banner.
|
|
82
|
+
char: The character to use for the border (default: '=').
|
|
83
|
+
width: The width of the banner (default: 50).
|
|
84
|
+
|
|
85
|
+
Returns:
|
|
86
|
+
A formatted banner string.
|
|
87
|
+
|
|
88
|
+
Example:
|
|
89
|
+
>>> from greetify import banner
|
|
90
|
+
>>> print(banner("Hello World"))
|
|
91
|
+
"""
|
|
92
|
+
if width < len(text) + 4:
|
|
93
|
+
width = len(text) + 4
|
|
94
|
+
|
|
95
|
+
border = char * width
|
|
96
|
+
padding = width - 2
|
|
97
|
+
centered_text = text.center(padding)
|
|
98
|
+
|
|
99
|
+
return f"""
|
|
100
|
+
{border}
|
|
101
|
+
{char}{centered_text}{char}
|
|
102
|
+
{border}
|
|
103
|
+
""".strip()
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def time_greeting(name: str) -> str:
|
|
107
|
+
"""
|
|
108
|
+
Generate a time-appropriate greeting.
|
|
109
|
+
|
|
110
|
+
Args:
|
|
111
|
+
name: The name of the person to greet.
|
|
112
|
+
|
|
113
|
+
Returns:
|
|
114
|
+
A greeting based on the current time of day.
|
|
115
|
+
"""
|
|
116
|
+
hour = datetime.now().hour
|
|
117
|
+
|
|
118
|
+
if 5 <= hour < 12:
|
|
119
|
+
period = "Good morning"
|
|
120
|
+
emoji = "🌅"
|
|
121
|
+
elif 12 <= hour < 17:
|
|
122
|
+
period = "Good afternoon"
|
|
123
|
+
emoji = "☀️"
|
|
124
|
+
elif 17 <= hour < 21:
|
|
125
|
+
period = "Good evening"
|
|
126
|
+
emoji = "🌆"
|
|
127
|
+
else:
|
|
128
|
+
period = "Hello, night owl"
|
|
129
|
+
emoji = "🌙"
|
|
130
|
+
|
|
131
|
+
return f"{emoji} {period}, {name}!"
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: phi_hippo
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A fun greeting utility — generate personalized greetings, motivational quotes, and ASCII banners!
|
|
5
|
+
Author-email: Your Name <your.email@example.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/yourusername/phi_hippo
|
|
8
|
+
Project-URL: Issues, https://github.com/yourusername/phi_hippo/issues
|
|
9
|
+
Keywords: greetings,fun,cli,utility,motivation
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Utilities
|
|
20
|
+
Requires-Python: >=3.8
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
|
|
25
|
+
# 🦛 phi_hippo
|
|
26
|
+
|
|
27
|
+
A fun Python package that generates personalized greetings, motivational quotes, and ASCII art banners!
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pip install phi_hippo
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
### Python API
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
from phi_hippo import greet, motivate, banner, colorize
|
|
41
|
+
|
|
42
|
+
# Generate a greeting
|
|
43
|
+
print(greet("Alice"))
|
|
44
|
+
# Hey Alice! 👋 Hope you're having an awesome day!
|
|
45
|
+
|
|
46
|
+
# Try different styles
|
|
47
|
+
print(greet("Bob", style="pirate"))
|
|
48
|
+
# Ahoy, Bob! 🏴☠️ Welcome aboard, ye scallywag!
|
|
49
|
+
|
|
50
|
+
# Get motivated
|
|
51
|
+
print(motivate())
|
|
52
|
+
# 🚀 You're capable of amazing things!
|
|
53
|
+
|
|
54
|
+
# Create a banner
|
|
55
|
+
print(banner("Hello World"))
|
|
56
|
+
# ==================================================
|
|
57
|
+
# = Hello World =
|
|
58
|
+
# ==================================================
|
|
59
|
+
|
|
60
|
+
# Add color to terminal output
|
|
61
|
+
print(colorize("Success!", "green", bold=True))
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Command Line
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Greet someone
|
|
68
|
+
phi_hippo hello Alice
|
|
69
|
+
phi_hippo hello Bob --style pirate --color cyan
|
|
70
|
+
|
|
71
|
+
# Get a motivational quote
|
|
72
|
+
phi_hippo motivate
|
|
73
|
+
|
|
74
|
+
# Create a banner
|
|
75
|
+
phi_hippo banner "My Project" --width 60 --char "*"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Available Greeting Styles
|
|
79
|
+
|
|
80
|
+
| Style | Example |
|
|
81
|
+
|----------------|------------------------------------------------------|
|
|
82
|
+
| `friendly` | Hey Alice! 👋 Hope you're having an awesome day! |
|
|
83
|
+
| `formal` | Good day, Alice. It is a pleasure to make your acquaintance. |
|
|
84
|
+
| `enthusiastic` | OMG Alice!!! 🎉🎉🎉 SO GREAT TO SEE YOU!!! |
|
|
85
|
+
| `pirate` | Ahoy, Alice! 🏴☠️ Welcome aboard, ye scallywag! |
|
|
86
|
+
|
|
87
|
+
## Available Colors
|
|
88
|
+
|
|
89
|
+
`red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
MIT License — see [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/phi_hippo/__init__.py
|
|
5
|
+
src/phi_hippo/cli.py
|
|
6
|
+
src/phi_hippo/colors.py
|
|
7
|
+
src/phi_hippo/greetings.py
|
|
8
|
+
src/phi_hippo.egg-info/PKG-INFO
|
|
9
|
+
src/phi_hippo.egg-info/SOURCES.txt
|
|
10
|
+
src/phi_hippo.egg-info/dependency_links.txt
|
|
11
|
+
src/phi_hippo.egg-info/entry_points.txt
|
|
12
|
+
src/phi_hippo.egg-info/top_level.txt
|
|
13
|
+
tests/test_greetings.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
phi_hippo
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"""Tests for the phi_hippo package."""
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
from phi_hippo import greet, motivate, banner, colorize
|
|
5
|
+
from phi_hippo.greetings import time_greeting
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class TestGreet:
|
|
9
|
+
"""Tests for the greet function."""
|
|
10
|
+
|
|
11
|
+
def test_friendly_greeting(self):
|
|
12
|
+
result = greet("Alice")
|
|
13
|
+
assert "Alice" in result
|
|
14
|
+
assert "👋" in result
|
|
15
|
+
|
|
16
|
+
def test_formal_greeting(self):
|
|
17
|
+
result = greet("Bob", style="formal")
|
|
18
|
+
assert "Bob" in result
|
|
19
|
+
assert "pleasure" in result
|
|
20
|
+
|
|
21
|
+
def test_enthusiastic_greeting(self):
|
|
22
|
+
result = greet("Charlie", style="enthusiastic")
|
|
23
|
+
assert "Charlie" in result
|
|
24
|
+
assert "🎉" in result
|
|
25
|
+
|
|
26
|
+
def test_pirate_greeting(self):
|
|
27
|
+
result = greet("Dave", style="pirate")
|
|
28
|
+
assert "Dave" in result
|
|
29
|
+
assert "Ahoy" in result
|
|
30
|
+
|
|
31
|
+
def test_invalid_style_raises_error(self):
|
|
32
|
+
with pytest.raises(ValueError, match="Unknown style"):
|
|
33
|
+
greet("Eve", style="robot")
|
|
34
|
+
|
|
35
|
+
def test_default_style_is_friendly(self):
|
|
36
|
+
result = greet("Frank")
|
|
37
|
+
assert "Hey Frank" in result
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class TestMotivate:
|
|
41
|
+
"""Tests for the motivate function."""
|
|
42
|
+
|
|
43
|
+
def test_returns_string(self):
|
|
44
|
+
result = motivate()
|
|
45
|
+
assert isinstance(result, str)
|
|
46
|
+
assert len(result) > 0
|
|
47
|
+
|
|
48
|
+
def test_returns_different_quotes(self):
|
|
49
|
+
quotes = {motivate() for _ in range(50)}
|
|
50
|
+
assert len(quotes) > 1, "motivate() should return varied quotes"
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class TestBanner:
|
|
54
|
+
"""Tests for the banner function."""
|
|
55
|
+
|
|
56
|
+
def test_basic_banner(self):
|
|
57
|
+
result = banner("Hello")
|
|
58
|
+
assert "Hello" in result
|
|
59
|
+
assert "=" in result
|
|
60
|
+
|
|
61
|
+
def test_custom_character(self):
|
|
62
|
+
result = banner("Test", char="*")
|
|
63
|
+
assert "*" in result
|
|
64
|
+
assert "=" not in result
|
|
65
|
+
|
|
66
|
+
def test_custom_width(self):
|
|
67
|
+
result = banner("Hi", width=30)
|
|
68
|
+
lines = result.strip().split("\n")
|
|
69
|
+
assert len(lines[0]) == 30
|
|
70
|
+
|
|
71
|
+
def test_auto_width_expansion(self):
|
|
72
|
+
long_text = "This is a very long banner text"
|
|
73
|
+
result = banner(long_text, width=10)
|
|
74
|
+
assert long_text in result
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class TestColorize:
|
|
78
|
+
"""Tests for the colorize function."""
|
|
79
|
+
|
|
80
|
+
def test_basic_colorize(self):
|
|
81
|
+
result = colorize("Hello", "green")
|
|
82
|
+
assert "Hello" in result
|
|
83
|
+
assert "\033[92m" in result
|
|
84
|
+
assert "\033[0m" in result
|
|
85
|
+
|
|
86
|
+
def test_bold_colorize(self):
|
|
87
|
+
result = colorize("Bold", "red", bold=True)
|
|
88
|
+
assert "\033[1m" in result
|
|
89
|
+
assert "\033[91m" in result
|
|
90
|
+
|
|
91
|
+
def test_invalid_color_raises_error(self):
|
|
92
|
+
with pytest.raises(ValueError, match="Unknown color"):
|
|
93
|
+
colorize("Text", "rainbow")
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
class TestTimeGreeting:
|
|
97
|
+
"""Tests for the time_greeting function."""
|
|
98
|
+
|
|
99
|
+
def test_returns_string_with_name(self):
|
|
100
|
+
result = time_greeting("Alice")
|
|
101
|
+
assert "Alice" in result
|
|
102
|
+
assert isinstance(result, str)
|