Skip to main content

The famous cowsay for GNU/Linux is now available for python

Project description

cowsay PyPI - Python Version Github
Downloads Downloads Downloads

Introduction

A python API / console script for the famous linux cowsay
Take a look at CHANGELOG.md for the changes

Brief History

cowsay for GNU/Linux was initially written in perl by Tony Monroe (tony@nog.net), with suggestions from Shannon Appel (appel@CSUA.Berkeley.EDU) and contributions from Anthony Polito (aspolito@CSUA.Berkeley.EDU).

Installation

pip install cowsay

API Usage

>>> import cowsay

>>> cowsay.cow('Hello World')
 ___________
| Hello World |
  ===========
           \
            \
              ^__^
              (oo)\_______
              (__)\       )\/\
                  ||----w |
                  ||     ||


>>> print(cowsay.get_output_string('cow', 'Hello World'))
  ___________
| Hello World |
  ===========
           \
            \
              ^__^
              (oo)\_______
              (__)\       )\/\
                  ||----w |
                  ||     ||


>>> cowsay.cow('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris blandit rhoncus nibh. Mauris mi mauris, molestie vel metus sit amet, aliquam vulputate nibh.')
  _________________________________________________
 /                                                 \
| Lorem ipsum dolor sit amet, consectetur adipiscin |
| g elit. Mauris blandit rhoncus nibh. Mauris mi ma |
| uris, molestie vel metus sit amet, aliquam vulput |
| ate nibh.                                         |
 \                                                 /
  =================================================
                                                 \
                                                  \
                                                    ^__^
                                                    (oo)\_______
                                                    (__)\       )\/\
                                                        ||----w |
                                                        ||     ||


>>> my_fish = r'''
\
 \  
        /`·.¸
     /¸...¸`:·
 ¸.·´  ¸   `·.¸.·´)
: © ):´;      ¸  {
 `·.¸ `·  ¸.·´\`·¸)
     `\\´´\¸.·´
'''

>>> cowsay.draw('Sharks are my best friend', my_fish)
  _________________________
| Sharks are my best friend |
  =========================
                         \
                          \  
                                 /`·.¸
                              /¸...¸`:·
                          ¸.·´  ¸   `·.¸.·´)
                         : © ):´;      ¸  {
                          `·.¸ `·  ¸.·´\`·¸)
                              `\\´´\¸.·´

Command Line Usage

$ cowsay -t "Hello World"
  ___________
| Hello World |
  ===========
           \
            \
              ^__^
              (oo)\_______
              (__)\       )\/\
                  ||----w |
                  ||     ||


$ cowsay -t "Hello World" -c "tux"
  ___________
| Hello World |
  ===========
                \
                 \
                  \
                   .--.
                  |o_o |
                  |:_/ |
                 //   \ \
                (|     | )
               /'\_   _/`\
               \___)=(___/

More Characters

>>> cowsay.char_names
['beavis', 'cheese', 'cow', 'daemon', 'dragon', 'fox', 'ghostbusters', 'kitty',
'meow', 'miki', 'milk', 'octopus', 'pig', 'stegosaurus', 'stimpy', 'trex', 
'turkey', 'turtle', 'tux']


>>> cowsay.char_funcs
{'beavis': <function func at 0x104b734c0>, 
'cheese': <function func at 0x104d285e0>, 
...
'tux': <function func at 0x104d28f70>}


>>> len(cowsay.chars)
19

Contributing

Guide: CONTRIBUTING.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cowsay-6.0.tar.gz (25.2 kB view hashes)

Uploaded Source

Built Distributions

cowsay-6.0-py3-none-any.whl (25.4 kB view hashes)

Uploaded Python 3

cowsay-6.0-py2.py3-none-any.whl (25.4 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page