The basic library for coding
Project description
cozy-kit
A cozy Python package with greetings, quotes, bedtime stories, timers, and text utilities.
Created by Youssef
Features
Open Section
Greeting
- Welcome messages
- Goodbye messages
- Morning greetings
- Afternoon greetings
- Evening greetings
- Bedtime stories
- Motivational quotes
- Fun facts
- Automatic greetings based on time & season
Timer
- Countdown timers
- Pomodoro timers
- Stopwatch support
- Time waiting utilities
- Current time utilities
TextStudio
- Morse code conversion
- Caesar cipher
- Text formatting utilities
- Word & character counting
- Punctuation removal
- Snake case conversion
- Letter spacing utilities
Requirements
- Python +3.11
Installation
Install
pip install cozy-kit
Upgrade
pip install --upgrade cozy-kit
Quick Example
from cozy_kit import Greeting
user = Greeting(
name="Youssef",
nickname="Yoyo"
)
print(user.welcome())
Output
Welcome Youssef!
Or welcome Yoyo!
Greeting Class
Import
from cozy_kit import Greeting
Create an object
person = Greeting(
name='Example',
age=12,
gender='male',
nickname='Example.Nickname'
)
Available Functions
| Function | Description |
|---|---|
welcome() |
Welcomes the user |
bye(destination) |
Says goodbye |
good_morning() |
Returns a morning quote |
good_afternoon() |
Returns an afternoon quote |
good_evening() |
Returns an evening quote |
good_night() |
Returns a bedtime story |
auto_greet() |
Automatically selects a greeting |
motivate() |
Returns a motivational quote |
fun_facts() |
Returns a random fun fact |
Greeting Examples
Usage
from cozy_kit import Greeting
user = Greeting(
name="youssef",
age=16,
gender="male",
nickname="joe"
)
print(user.welcome())
print(user.bye("school"))
print(user.good_morning())
print(user.fun_facts())
print(user.auto_greet())
Example Output
welcome()
Welcome Youssef!
Or welcome Joe!
bye()
Bye Youssef! Have a nice day at school!
Or bye Joe!
good_morning()
Good Morning Youssef!
Or good morning Joe!
Anyways, here's a quick morning quote.
Albert Einstein
Life is like riding a bicycle.
To keep your balance, you must keep moving.
fun_facts()
Space Facts
A day on Venus is longer than a year on Venus.
auto_greet()
Good Afternoon Youssef!
Or good afternoon Joe!
Steve Jobs
The only way to do great work is to love what you do.
Timer Class
Import
from cozy_kit import Timer
Create an object
timer = Timer()
Available Functions
| Function | Description |
|---|---|
countdown(count, time_type, show) |
Starts a countdown |
pomodoro(work_time, break_time, long_break_time, show) |
Starts a Pomodoro timer |
wait(count, time_type) |
Sleeps for a specific duration |
get_time() |
Returns the current time |
start_stopwatch() |
Starts the stopwatch |
end_stopwatch() |
Stops the stopwatch |
Supported Time Types
| Type | Meaning |
|---|---|
sec |
Seconds |
min |
Minutes |
hour |
Hours |
Countdown Example
Usage
from cozy_kit import Timer
timer = Timer()
timer.countdown(
count=5,
time_type='sec',
show=print
)
Output
00:05
00:04
00:03
00:02
00:01
⏰ Time's up!
Stopwatch Example
Usage
from cozy_kit import Timer
import time
timer = Timer()
timer.start_stopwatch()
time.sleep(3)
elapsed = timer.end_stopwatch()
print(elapsed)
Output
0:00:03.002194
Wait Example
Usage
from cozy_kit import Timer
timer = Timer()
print("Waiting...")
timer.wait(3, "sec")
print("Done!")
Output
Waiting...
Done!
Pomodoro Example
Usage
from cozy_kit import Timer
timer = Timer()
timer.pomodoro(
work_time=1,
break_time=1,
long_break_time=2,
show=print
)
Output
💻 Work Time
01:00
...
☕ Short Break Time
01:00
...
💻 Work Time
01:00
...
⏰ Long Break Time
02:00
...
TextStudio Class
Import
from cozy_kit import TextStudio
Create an object
text_editor = TextStudio()
Available Functions
| Function | Description |
|---|---|
to_morse(text) |
Converts text to Morse code |
to_upper(text) |
Converts text to uppercase |
to_title(text) |
Converts text to title case |
to_lower(text) |
Converts text to lowercase |
space_out_letters(text) |
Adds spaces between letters |
replace_with_spaces(text, replacement) |
Replaces characters with spaces |
caesar(text, shift) |
Caesar cipher encryption |
reverse(text) |
Reverses text |
word_count(text) |
Counts words |
char_count(text) |
Counts characters |
remove_spaces(text) |
Removes spaces |
snake(text) |
Converts text to snake_case |
remove_punctuation(text) |
Removes punctuation |
TextStudio Example
Usage
from cozy_kit import TextStudio
studio = TextStudio()
text = "Hello World"
print(studio.to_upper(text))
print(studio.to_lower(text))
print(studio.to_title(text))
print(studio.reverse(text))
print(studio.snake(text))
print(studio.space_out_letters(text))
print(studio.to_morse(text))
print(studio.caesar(text, 3))
print(studio.word_count(text))
print(studio.char_count(text))
print(studio.remove_spaces(text))
print(studio.remove_punctuation("Hello, World!"))
Output
to_upper()
HELLO WORLD
to_lower()
hello world
reverse()
dlroW olleH
snake()
hello_world
space_out_letters()
H e l l o W o r l d
to_morse()
.... . .-.. .-.. --- / .-- --- .-. .-.. -..
caesar()
Khoor Zruog
word_count()
2
char_count()
11
remove_spaces()
HelloWorld
remove_punctuation()
Hello World
Full Package Example
Open Full Example
Usage
from cozy_kit import Greeting, Timer, TextStudio
import time
# Greeting
user = Greeting(
name="Youssef",
age=16,
gender="male",
nickname="Yoyo"
)
print(user.welcome())
print(user.good_morning())
print(user.fun_facts())
# TextStudio
studio = TextStudio()
text = "Hello World"
print(studio.to_upper(text))
print(studio.reverse(text))
print(studio.to_morse(text))
print(studio.caesar(text, 3))
# Timer
timer = Timer()
timer.countdown(
count=5,
time_type='sec',
show=print
)
timer.start_stopwatch()
time.sleep(2)
print(timer.end_stopwatch())
Example Output
Welcome Youssef!
Or welcome Yoyo!
Good Morning Youssef!
Or good morning Yoyo!
Anyways, here's a quick morning quote.
Albert Einstein
Life is like riding a bicycle.
To keep your balance, you must keep moving.
Space Facts
A day on Venus is longer than a year on Venus.
HELLO WORLD
dlroW olleH
.... . .-.. .-.. --- / .-- --- .-. .-.. -..
Khoor Zruog
00:05
00:04
00:03
00:02
00:01
⏰ Time's up!
0:00:02.001392
Notes
showparameters can use:print- Tkinter labels
- logging functions
- speech engines
- custom output systems
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
cozy_kit-0.2.7.tar.gz
(12.2 kB
view details)
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
cozy_kit-0.2.7-py3-none-any.whl
(11.5 kB
view details)
File details
Details for the file cozy_kit-0.2.7.tar.gz.
File metadata
- Download URL: cozy_kit-0.2.7.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5cdf8ade6ceb0ffe7aea5733860dd145f33c7e5ef99a384e9d2e02444a8797d
|
|
| MD5 |
78d8ff23d959a704d21ae93f7027c8c4
|
|
| BLAKE2b-256 |
0f00750ec5736dc2c683d8e58171583f8627162bcbf0b728ae707cc92491a1dc
|
File details
Details for the file cozy_kit-0.2.7-py3-none-any.whl.
File metadata
- Download URL: cozy_kit-0.2.7-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75a0f012abf2e6a0cd282982047110a377cec9a05a4096d2de6e7ffb8ffb46bd
|
|
| MD5 |
9550088947e59789bf9ccbc28528572b
|
|
| BLAKE2b-256 |
3d379c1e277866c6654c77715c4f6ca6c29d510b1afc3483ed00a0395031207c
|