A fun package that generates compliments.
Project description
BohanCompliment
A fun Python package that generates random compliments to brighten your day.
Table of Contents
- Description
- PyPI Page
- Installation
- Virtual Environment & Dependencies
- Running BohanCompliment
- Examples
- Contributing
- Author
Description
BohanCompliment is a Python package designed to generate random compliments. Whether you need a quick boost or want to share kind words with friends and colleagues, BohanCompliment provides a variety of functions to suit your needs. With support for multiple languages and personalized messages, it's a versatile tool for spreading positivity.
PyPI Page
You can find BohanCompliment on PyPI HERE.
Installation
Install BohanCompliment with pip:
pip install BohanCompliment
Virtual Environment & Dependencies
Setting up the virtual environment:
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Running BohanCompliment
After installation, BohanCompliment can be directly ran in Python scripts or interactivelty via the Python shell. Import the ComplimentGenerator class and create an instance:
from BohanCompliment import ComplimentGenerator
generator = ComplimentGenerator()
Examples
Function Parameters
- compliment(name: str)
- personalized_compliment(name: str, trait: str)
- multi_compliment(name: str, count: int)
- compliment_in_language(name: str, language: str)
- add_compliment(compliment: str)
- add_translation(language: str, compliments: List[str])
- list_languages()
Available Functions:
compliment(name): Returns a random compliment for the given name:
from BohanCompliment import compliment
print(compliment("Alice"))
# Output: You're an awesome person, Alice!
personalized_compliment(name, trait): Returns a compliment focusing on a specific trait:
from BohanCompliment import personalized_compliment
print(personalized_compliment("Bob", "sense of humor"))
# Output: Bob, your sense of humor is truly remarkable!
multi_compliment(name, count): Returns multiple compliments
from BohanCompliment import multi_compliment
compliments = multi_compliment("Charlie", 3)
for c in compliments:
print(c)
# Output:
# You're a fantastic problem solver, Charlie!
# You have a great sense of humor, Charlie!
# Charlie, your code is so elegant!
compliment_in_language(name, language): Returns a compliment in a specific language ('en', 'es', 'fr')
from BohanCompliment import compliment_in_language
print(compliment_in_language("Dana", "es"))
# Output: ¡Eres increíble, Dana!
print(compliment_in_language("Eve", "de"))
# Output: Language 'de' not supported.
add_compliment(compliment: str): Adds a new compliment to the generator
from BohanCompliment import ComplimentGenerator
generator = ComplimentGenerator()
generator.add_compliment("{name}, your dedication to learning is inspiring!")
print(generator.compliment("Frank"))
# Possible Output: Frank, your dedication to learning is inspiring!
add_translation(language: str, compliments: List[str]): Adds compliments in a new language
from BohanCompliment import ComplimentGenerator
generator = ComplimentGenerator()
italian_compliments = [
"Sei fantastico, {name}!",
"{name}, il tuo lavoro è eccezionale!"
]
generator.add_translation("it", italian_compliments)
print(generator.compliment_in_language("Giulia", "it"))
# Output: Sei fantastico, Giulia!
list_languages(): Lists all supported languages
from BohanCompliment import ComplimentGenerator
generator = ComplimentGenerator()
print(generator.list_languages())
# Output: ['en', 'es', 'fr', 'de', 'it']
Contributing
To contribute to this project, here are the following steps:
Clone the GitHub repository
git clone https://github.com/software-students-fall2024/3-python-package-bowohan.git
cd BohanCompliment
Set up and activate the virtual environment
python -m venv venv
source venve/bin/activate
Install the required dependencies
pip install -r requirements.txt
Build and test the python package
python -m build
pytest
Author
Bohan Hou
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bohancompliment-0.2.0.tar.gz.
File metadata
- Download URL: bohancompliment-0.2.0.tar.gz
- Upload date:
- Size: 46.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7dbdd132469d03c1384e2719b95e0251590c3182c58fe019ec871602bf20fb9f
|
|
| MD5 |
2ea337ae2ce15c8d879a8650f18f55ab
|
|
| BLAKE2b-256 |
2d7b7a4041346f11c773b11c6e0c15a6e3e700cd124d2f37537f8ec8dd2eb0ac
|
File details
Details for the file bohancompliment-0.2.0-py3-none-any.whl.
File metadata
- Download URL: bohancompliment-0.2.0-py3-none-any.whl
- Upload date:
- Size: 31.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5ccd494f7258b0abf6ae4433ea233565534f606d29b68db7de9abaa1cde33c1
|
|
| MD5 |
35e621f7679d543fb601b7a7afb4b8df
|
|
| BLAKE2b-256 |
97f6a4266e02d7ced2867728a2f86097c6ec006cfa387587d795c4e6ae4c5de7
|