Skip to main content

ccowsay

screenshot

🐮 A tool for generating customizable ASCII art messages with speech bubbles and cow-style templates, supporting styled text using AnsiMarkup.

Features

  • Custom .ccow templates define ASCII art structure.
  • Styled text formatting (colors, bold, italic, underline) via AnsiMarkup.
  • Text alignment (left, center, right), word wrapping, and whitespace replacement.
  • Dynamic template variables (eyes, tongue, etc.) that can be overridden.
  • Simple configuration directory for templates and defaults.

Installation

pipx install ccowsay

Basic Usage

ccowsay "Hello World!"

For full details of supported tags and syntax see the AnsiMarkup documentation.

Command-Line Options

Option Description Default
-f, --format Path or alias to a .ccow template @/cow.ccow
-a, --align Text alignment: left, center, right left
-w, --wrap Max width before wrapping (use -1 to disable wrapping) 40
--replace-whitespace Replace tabs/newlines with spaces False
-c, --corners Four characters for bubble corners (TL, TR, BL, BR) / \ / \
-s, --sides Four characters for bubble sides (top, bottom, left, right) | - | -
-v, --values JSON string of template variable overrides {}
-l, --list List available .ccow templates —
--list-online List online available .ccow templates —
--get Download a .ccow template from a GitHub repository and save it to the user config directory —

Custom Templates

Templates live in your config directory (e.g., ~/.config/ccowsay/). Each .ccow file has two parts: JSON metadata, then ASCII art, separated by ---. Example:

{
  "eyes": "oo",
  "tongue": "  "
}
---
{message}
        {backslash}   ^__^
         {backslash}  ({eyes})\_______
            (__)\       )\/\
             {tongue} ||----w |
                ||     ||

Override variables with --values, for example:

ccowsay -f "@/cow.ccow" -v '{"eyes": "xx", "tongue": "U "}' "I'm tired..."

Coloring with XML-Style Tags

You can use XML-style tags from ansimarkup to add colors, bold, or italic text inside your .ccow templates.

[!WARNING] Do not use these tags directly in messages passed to ccowsay — they are intended for ASCII art templates only.

Example inside a .ccow file:

{
  "eyes": "oo",
  "tongue": "  "
}
---
<red>{message}</red>
        {backslash}   ^__^
         {backslash}  (<green>{eyes}</green>)\_______
            (__)\       )\/\
             {tongue} ||----w |
                ||     ||

This ensures that all colors and styles are applied safely when rendering the ASCII art.

Using Templates from the Config Directory

Any .ccow file placed in your user config directory (usually ~/.config/ccowsay/) can be referenced using the @/ prefix.

For example:

ccowsay -f "@/cow.ccow" "Hello World!"
  • @/cow refers to cow.ccow inside your config directory.
  • This works for any custom template you add there.
  • The default configuration also uses this syntax to load the built-in cow.

Downloading Templates

Use --get flag to download and store .ccow files locally:

ccowsay --get path/to/file.ccow

For more details, check out ccows.

Embedding in Python

from ccowsay import ccowsay, TextAlign

ascii_art = ccowsay(
    "<green>Hello from code!</green>",
    open("cow.ccow").read(),
    align=TextAlign.CENTER,
    width=40,
    eyes="oO",
    tongue="U "
)
print(ascii_art)

License

MIT License — free to use, modify, and distribute.

Metadata

Release files for ccowsay 2.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ccowsay 2.1.1
File Size Uploaded Provenance Actions
ccowsay-2.1.1.tar.gz 5.3 kB Without provenance Details for ccowsay-2.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ccowsay 2.1.1
File Interpreter ABI Platform Actions
ccowsay-2.1.1-py3-none-any.whl Python 3 none any Details for ccowsay-2.1.1-py3-none-any.whl

Total release size: 11.7 kB

Release files / ccowsay-2.1.1.tar.gz

Download URL ccowsay-2.1.1.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
736d50cff4d21d06196f10bf31f3ed266492dde461277d972d479274d44a21bd
BLAKE2b-256 checksum
How to use checksums
b993b45a857287557cf130416e6f3a66e7bcb6ecaa9d8b44b518943891d0eddd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.14.0 Linux/6.17.7-300.fc43.x86_64

Release files / ccowsay-2.1.1-py3-none-any.whl

Download URL ccowsay-2.1.1-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3e103d87993350edbae60809a4138f68be4860682c7661648817f9586810f70
BLAKE2b-256 checksum
How to use checksums
c4bd081b27d0ce321fb2bfcbba773f9a3af67c85423861b417aa21ba68289df4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.14.0 Linux/6.17.7-300.fc43.x86_64

Security for ccowsay 2.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page