Skip to content
FelineFantasyPublic

About

A cute ASCII cat library for Python that says, warns, thinks, and asks questions.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

40 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

catsay 🐱 Python Version License

A cute ASCII cat library that says, warns, thinks, and asks questions. Perfect for making your CLI output more fun and expressive!

πŸ“ Description

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

Features:

  • 🎭 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

βš™οΈ Installation

Option 1: Install from PyPI

pip install catsay-py

Option 2: Copy the file

Just copy catsay.py into your project:

# Place catsay.py in your project directory

Option 3: Install from Git

git clone https://github.com/FelineFantasy/catsay
cd catsay
pip install .

Note: this package installs the top-level catsay module. If the unrelated catsay distribution is installed, remove it first (pip uninstall catsay), otherwise it shadows this library.

πŸš€ Usage

Basic

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}")

Moods

say("I'm happy!", mood="happy")
say("Zzz...", mood="sleepy")
say("I'm angry!", mood="angry")
say("I love you!", mood="love")

Multi-line messages

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?
   > ^ <

Without text

say()  # Just a cute cat
think()  # Thinking cat
warn()  # Warning cat
error()  # Error cat

πŸ“– API Reference

say(text: str = "", mood: str = "happy") -> None

The 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!
#    > ^ <

warn(text: str = "") -> None

The cat outputs a warning.

Parameter Type Default Description
text str "" Warning message

Example:

warn("Low disk space!")
#    /\_/\
#   ( -.o )  ~  Low disk space! ~~~
#    > ^ <

error(text: str = "Error") -> None

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! !!!
#    > ^ <

think(text: str = "", mood: str = "happy") -> None

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...
#    > ^ <

ask(question: str = "") -> str

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}!")

🎭 Moods

Mood Face Description
happy o.o Default, friendly cat
sleepy -.- Tired, drowsy cat
angry >.< Angry, frustrated cat
love ^.^ Loving, affectionate cat

πŸ§ͺ Full Example

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?")

πŸ§ͺ Testing

Run the test suite with the standard library unittest:

python -m unittest discover -s tests -v

Tests also run automatically on every push and pull request via GitHub Actions.

πŸ“ Project Structure

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

πŸ›  Technologies

  • Python 3.8+ β€” Pure standard library, no external dependencies

πŸ“‹ Requirements

  • Python 3.8+
  • No external dependencies

πŸ’– Support the Project

If you enjoy catsay and want to help keep the project alive, you can support me here:

DonationAlerts

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! ❀️

πŸ‘€ Author

  • FelineFantasy
  • License: MIT

About

A cute ASCII cat library for Python that says, warns, thinks, and asks questions.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages