or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

Files

docs

cowacters.mdindex.mdutilities.md

cowacters.mddocs/

0

# Cowacters

1

2

Cowpy provides 45 unique character implementations, all inheriting from the base Cowacter class. Each cowacter has its own distinctive ASCII art design while supporting the same customization options.

3

4

## Capabilities

5

6

### Base Cowacter Class

7

8

The foundation class that all cowacter implementations inherit from, providing message formatting, bubble generation, and customization options.

9

10

```python { .api }

11

class Cowacter:

12

def __init__(self, eyes='default', thoughts=False, tongue=False, body=None):

13

"""

14

Initialize a cowacter with customization options.

15

16

Args:

17

eyes (str): Eye type from EYES dict ('default', 'borg', 'dead', 'greedy', 'paranoid', 'stoned', 'tired', 'wired', 'young')

18

thoughts (bool): Use thought bubble (o) instead of speech bubble (\)

19

tongue (bool): Display tongue ('U ') in the cowacter

20

body (str, optional): Custom ASCII art body, uses default cow if None

21

"""

22

23

def milk(self, msg):

24

"""

25

Generate cowsay output with the given message.

26

27

Args:

28

msg (str): Message for the cowacter to say/think. If empty/None, displays cowacter configuration info.

29

30

Returns:

31

str: Complete ASCII art output with speech/thought bubble and cowacter

32

"""

33

```

34

35

### Cowacter Retrieval

36

37

Get cowacter classes by name from the registry.

38

39

```python { .api }

40

def get_cow(name='default'):

41

"""

42

Get a cowacter class by name.

43

44

Args:

45

name (str): Name of the cowacter (case-sensitive)

46

47

Returns:

48

class or str: Cowacter class if found, or string 'default' if name not found

49

"""

50

```

51

52

### Available Cowacter Classes

53

54

All cowacter classes follow the same interface as the base Cowacter class, accepting the same constructor parameters (eyes, thoughts, tongue) and providing the milk() method.

55

56

#### Standard Cowacters

57

58

```python { .api }

59

# Default cow character

60

class Cowacter: ...

61

62

# Animal characters

63

class BudFrogs: ...

64

class Bunny: ...

65

class Koala: ...

66

class Moose: ...

67

class Sheep: ...

68

class Squirrel: ...

69

class Turkey: ...

70

class Turtle: ...

71

72

# Fictional characters

73

class Beavis: ...

74

class Daemon: ...

75

class HelloKitty: ...

76

class Kiss: ...

77

class Kitty: ...

78

class Meow: ...

79

class Ren: ...

80

class Stimpy: ...

81

class Tux: ... # Linux penguin

82

83

# Fantasy/Sci-fi characters

84

class DragonAndCow: ...

85

class Ghostbusters: ...

86

class Kosh: ...

87

class LukeKoala: ... # Luke Skywalker koala

88

class MechAndCow: ...

89

class Vader: ... # Darth Vader cow

90

class VaderKoala: ... # Darth Vader koala

91

92

# Specialty designs

93

class Cheese: ...

94

class Cower: ...

95

class Eyes: ... # Many eyes design

96

class FlamingSheep: ...

97

class Milk: ... # Milk carton

98

class Moofasa: ... # Lion King parody

99

class Mutilated: ...

100

class Satanic: ...

101

class Skeleton: ...

102

class Small: ...

103

class Stegosaurus: ... # Dinosaur

104

class Supermilker: ...

105

class Surgery: ...

106

class ThreeEyes: ...

107

class Udder: ...

108

class www: ... # WWW cow

109

```

110

111

#### NSFW Cowacters

112

113

These cowacters contain adult content and are filtered by default in SFW mode.

114

115

```python { .api }

116

# Adult content cowacters (NSFW)

117

class BongCow: ... # Drug reference

118

class HeadInCow: ... # Adult content

119

class Sodomized: ... # Adult content

120

class Telebears: ... # Adult content

121

```

122

123

### Usage Examples

124

125

```python

126

from cowpy import cow

127

128

# Create any cowacter using its class directly

129

vader = cow.Vader(eyes='dead', thoughts=True)

130

message = vader.milk("I find your lack of faith disturbing")

131

print(message)

132

133

# Get cowacter by name

134

koala_class = cow.get_cow('koala')

135

koala = koala_class(tongue=True)

136

message = koala.milk("G'day mate!")

137

print(message)

138

139

# Create with different eye types

140

stoned_sheep = cow.Sheep(eyes='stoned')

141

paranoid_moose = cow.Moose(eyes='paranoid')

142

tired_tux = cow.Tux(eyes='tired')

143

144

# Default cowacter (classic cow)

145

default_cow = cow.Cowacter()

146

message = default_cow.milk("Moo!")

147

print(message)

148

149

# Empty message shows cowacter configuration

150

config_msg = default_cow.milk("")

151

print(config_msg) # Shows "Cowacter, eyes:default, tongue:False, thoughts:False"

152

```

153

154

### Registry Access

155

156

The COWACTERS dictionary contains all registered cowacter classes:

157

158

```python

159

# Get all cowacter names

160

cowacter_names = list(cow.COWACTERS.keys())

161

162

# Access specific cowacter class

163

VaderClass = cow.COWACTERS['vader']

164

vader_instance = VaderClass(eyes='wired')

165

```

166

167

### Implementation Notes

168

169

The source code contains duplicate class definitions for 'koala' and 'stegosaurus' cowacters. The later definitions override the earlier ones in the COWACTERS registry, so only the final implementations are accessible.