A cute ASCII cat library that says, warns, thinks, and asks questions. Perfect for making your CLI output more fun and expressive!
catsay is a tiny Python library that renders an ASCII cat with messages. It provides several functions for different use cases:
- π£οΈ
sayβ The cat says text with a given mood β οΈ warnβ The cat outputs a warning- β
errorβ The cat shows an error message - π
thinkβ The cat thinks thoughtfully - β
askβ The cat asks a question and returns the user's answer
- π 4 moods β happy, sleepy, angry, love
- π¦ Zero dependencies β Pure Python, no extra packages
- π Simple API β 5 functions for all use cases
- π¨ ASCII art β No external images or assets needed
- π¬ Interactive β
ask()reads user input
pip install catsay-pyJust copy catsay.py into your project:
# Place catsay.py in your project directorygit clone https://github.com/FelineFantasy/catsay
cd catsay
pip install .Note: this package installs the top-level
catsaymodule. If the unrelatedcatsaydistribution is installed, remove it first (pip uninstall catsay), otherwise it shadows this library.
from catsay import say, warn, error, think, ask
say("Hello, World!")
warn("Don't forget to feed the cat!")
error("Something went wrong!")
think("Hmm, interesting...")
answer = ask("What's your name?")
print(f"User said: {answer}")say("I'm happy!", mood="happy")
say("Zzz...", mood="sleepy")
say("I'm angry!", mood="angry")
say("I love you!", mood="love")say() and think() print every line of the text, aligned under the first one:
say("Feeding time!\nWhere is my bowl?") /\_/\
( o.o ) > Feeding time!
Where is my bowl?
> ^ <
say() # Just a cute cat
think() # Thinking cat
warn() # Warning cat
error() # Error catThe cat says text with a given mood. Multi-line text is printed one line per row.
| Parameter | Type | Default | Description |
|---|---|---|---|
text |
str |
"" |
Text to display |
mood |
str |
"happy" |
Cat mood: happy, sleepy, angry, love |
Raises: ValueError if mood is not supported
Example:
say("Meow!")
# /\_/\
# ( o.o ) > Meow!
# > ^ <The cat outputs a warning.
| Parameter | Type | Default | Description |
|---|---|---|---|
text |
str |
"" |
Warning message |
Example:
warn("Low disk space!")
# /\_/\
# ( -.o ) ~ Low disk space! ~~~
# > ^ <The cat outputs an error message (uses angry mood).
| Parameter | Type | Default | Description |
|---|---|---|---|
text |
str |
"Error" |
Error message |
Example:
error("File not found!")
# /\_/\
# ( >.< ) > !!! File not found! !!!
# > ^ <The cat says text thoughtfully (with < bubble). Multi-line text is printed one line per row.
| Parameter | Type | Default | Description |
|---|---|---|---|
text |
str |
"" |
Text to think about |
mood |
str |
"happy" |
Cat mood |
Raises: ValueError if mood is not supported
Example:
think("Hmm, interesting...")
# /\_/\
# ( o.o ) < Hmm, interesting...
# > ^ <The cat asks a question and returns the user's answer.
| Parameter | Type | Default | Description |
|---|---|---|---|
question |
str |
"" |
Question to ask |
Returns: str β User's input
Example:
name = ask("What's your name?")
print(f"Hello, {name}!")| Mood | Face | Description |
|---|---|---|
happy |
o.o |
Default, friendly cat |
sleepy |
-.- |
Tired, drowsy cat |
angry |
>.< |
Angry, frustrated cat |
love |
^.^ |
Loving, affectionate cat |
from catsay import say, warn, error, think, ask
print("=== say() ===\n")
say()
say("Meow!", mood="happy")
say("Zzz", mood="sleepy")
say("meow :(", mood="angry")
say("I love you!", mood="love")
print("\n=== warn() ===\n")
warn()
warn("Where's my food!")
print("\n=== error() ===\n")
error()
error("The cat has fallen!")
print("\n=== think() ===\n")
think()
think("Hmm", mood="happy")
think("Hmm", mood="sleepy")
think("Hmm", mood="angry")
think("Hmm", mood="love")
print("\n=== ask() ===\n")
ask()
ask("Where's my food?")Run the test suite with the standard library unittest:
python -m unittest discover -s tests -vTests also run automatically on every push and pull request via GitHub Actions.
catsay/
βββ .github/
β βββ FUNDING.yml # Support link for DonationAlerts
β βββ workflows/
β βββ tests.yml # CI workflow for running tests
βββ catsay.py # Main library
βββ README.md # Documentation
βββ LICENSE # MIT License
βββ pyproject.toml # Package configuration
βββ tests/
β βββ test_catsay.py # Unit tests
βββ .gitignore # Git ignore rules
- Python 3.8+ β Pure standard library, no external dependencies
- Python 3.8+
- No external dependencies
If you enjoy catsay and want to help keep the project alive, you can support me here:
Your support helps me:
- π± Keep developing cute tools
- π οΈ Add more moods and features
- β Stay awake while coding at 4 AM
Every little bit is appreciated! β€οΈ
- FelineFantasy
- License: MIT