CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-cowpy

A Python implementation of the classic cowsay program for generating ASCII art with various characters delivering messages

Pending

Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

Overview
Eval results
Files

index.mddocs/

Cowpy

A Python implementation of the classic cowsay program that generates ASCII art with various characters (cowacters) delivering messages in speech or thought bubbles. Cowpy provides both a command-line interface and a Python library with 45 different character designs.

Package Information

  • Package Name: cowpy
  • Language: Python
  • Installation: pip install cowpy
  • CLI Command: cowpy

Core Imports

from cowpy import cow

Access specific cowacter classes directly:

# Individual cowacter classes
from cowpy.cow import Moose, Vader, Tux, HelloKitty
from cowpy.cow import EYES, COWACTERS  # Constants

Basic Usage

from cowpy import cow

# Create a specific cowacter
moose = cow.Moose()
message = moose.milk("Hello from the moose!")
print(message)

# Use different options
cow_with_thoughts = cow.Moose(thoughts=True, eyes='dead', tongue=True)
message = cow_with_thoughts.milk("I'm thinking...")
print(message)

# Get a cowacter by name
cow_class = cow.get_cow('vader')
vader = cow_class()
message = vader.milk("I am your father")
print(message)

# Generate random cowacter output
random_message = cow.milk_random_cow("Random fun!")
print(random_message)

Architecture

Cowpy uses a class-based architecture centered around the Cowacter base class:

  • Cowacter Base Class: Handles message formatting, speech/thought bubbles, and eye/tongue customization
  • Cowacter Subclasses: 45+ character implementations with unique ASCII art
  • COWACTERS Registry: Dictionary mapping cowacter names to classes
  • Utility Functions: Helper functions for accessing cowacters, eyes, and generating random output

Capabilities

Core Cowacter System

The foundation of cowpy's functionality, providing the base Cowacter class and instantiation methods.

class Cowacter:
    def __init__(self, eyes='default', thoughts=False, tongue=False, body=None): ...
    def milk(self, msg): ...

def get_cow(name='default'): ...

Cowacters

Utility Functions

Helper functions for listing available options and generating random output.

def eye_options(): ...
def cow_options(): ...
def milk_random_cow(msg, sfw=True): ...
def get_cowacters(sfw=True, sort=False): ...
def get_eyes(sfw=True, sort=False): ...
def not_safe_for_work(cow='', eyes=''): ...

Utilities

Command Line Interface

Complete CLI implementation with argument parsing and interactive features.

def main(): ...

The CLI supports extensive options including cowacter selection, eye customization, thought bubbles, tongue display, random selection, and NSFW content filtering.

Types

# Eye type options
EYES = {
    'default': "oo",
    'borg': "==", 
    'dead': "xx",
    'greedy': "$$",
    'paranoid': "@@",
    'stoned': "**",
    'tired': "--",
    'wired': "OO", 
    'young': ".."
}

# NSFW content identifiers  
NOT_SAFE_FOR_WORK_COWACTERS = ['bongcow', 'sodomized', 'headincow', 'telebears']
NOT_SAFE_FOR_WORK_EYES = ['stoned']

Install with Tessl CLI

npx tessl i tessl/pypi-cowpy

docs

cowacters.md

index.md

utilities.md

tile.json