Skip to main content

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

Project description

Cowsay

A python API / console script for the famous linux-cowsay.
All contributions / forks are welcome.
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).

Check here for the list of contributors for this python package.
Check here for the change log.

Installation

pip install cowsay

Basic Usage

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

>>> print(cowsay.get_output_string('trex', 'Hello (extinct) World'))
  _____________________
| Hello (extinct) World |
  =====================
                            \
                             \
                              \
                               \
                                  .-=-==--==--.
                            ..-=="  ,'o`)      `.
                          ,'         `"'         \
                         :  (                     `.__...._
                         |                  )    /         `-=-.
                         :       ,vv.-._   /    /               `---==-._
                          \/\/\/VV ^ d88`;'    /                         `.
                              ``  ^/d88P!'    /             ,              `._
                                 ^/    !'   ,.      ,      /                  "-,,__,,--'""""-.
                                ^/    !'  ,'  \ . .(      (         _           )  ) ) ) ))_,-.\
                               ^(__ ,!',"'   ;:+.:%:a.     \:.. . ,'          )  )  ) ) ,"'    '
                               ',,,'','     /o:::":%:%a.    \:.:.:         .    )  ) _,'
                                """'       ;':::'' `+%%%a._  \%:%|         ;.). _,-""
                                       ,-='_.-'      ``:%::)  )%:|        /:._,"
                                      (/(/"           ," ,'_,'%%%:       (_,'
                                                     (  (//(`.___;        \
                                                      \     \    `         `
                                                       `.    `.   `.        :
                                                         \. . .\    : . . . :
                                                          \. . .:    `.. . .:
                                                           `..:.:\     \:...\
                                                            ;:.:.;      ::...:
                                                            ):%::       :::::;
                                                        __,::%:(        :::::
                                                     ,;:%%%%%%%:        ;:%::
                                                       ;,--""-.`\  ,=--':%:%:\
                                                      /"       "| /-".:%%%%%%%\
                                                                      ;,-"'`)%%)
                                                                     /"      "|

>>> cowsay.dragon('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.                                         |
 \                                                 /
  =================================================
                                                      \
                                                       \
                                                        \
                                                         \
                                                                               / \  //\
                                                                |\___/|      /   \//  \\
                                                                /0  0  \__  /    //  | \ \
                                                               /     /  \/_/    //   |  \  \
                                                               \@_^_\@'/   \/_   //    |   \   \
                                                               //_^_/     \/_ //     |    \    \
                                                            ( //) |        \///      |     \     \
                                                          ( / /) _|_ /   )  //       |      \     _\
                                                        ( // /) '/,_ _ _/  ( ; -.    |    _ _\.-~        .-~~~^-.
                                                      (( / / )) ,-{        _      `-.|.-~-.           .~         `.
                                                     (( // / ))  '/\      /                 ~-. _ .-~      .-~^-.  \
                                                     (( /// ))      `.   {            }                   /      \  \
                                                      (( / ))     .----~-.\        \-'                 .~         \  `. \^-.
                                                                 ///.----..>        \             _ -~             `.  ^-`  ^-_
                                                                   ///-._ _ _ _ _ _ _}^ - - - - ~                     ~-- ,.-~
                                                                                                                      /.-~



More characters

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

>>> cowsay.chars
{'beavis': <function func at 0x000002339858E310>, 'cheese': <function func at 0x000002339858E3A0>, 'daemon': <function func at 0x000002339858E430>, 'cow': <function func at 0x000002339858E4C0>, 'dragon': <function func at 0x000002339858E550>, 'ghostbusters': <function func at 0x000002339858E5E0>, 'kitty': <function func at 0x000002339858E670>, 'meow': <function func at 0x000002339858E700>, 'milk': <function func at 0x000002339858E790>, 'pig': <function func at 0x000002339858E820>, 'stegosaurus': <function func at 0x000002339858E8B0>, 'stimpy': <function func at 0x000002339858E940>, 'trex': <function func at 0x000002339858E9D0>, 'turkey': <function func at 0x000002339858EA60>, 'turtle': <function func at 0x000002339858EAF0>, 'tux': <function func at 0x000002339858EB80>}

>>> len(cowsay.chars)
16

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-4.0.tar.gz (24.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cowsay-4.0-py2.py3-none-any.whl (24.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file cowsay-4.0.tar.gz.

File metadata

  • Download URL: cowsay-4.0.tar.gz
  • Upload date:
  • Size: 24.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for cowsay-4.0.tar.gz
Algorithm Hash digest
SHA256 a9e1e5f957054010b7faa6406deb5f6aa5cb674498118bbbed0151f92c2dc20e
MD5 6cc95b4be1e82cd4f69cdd9926bb99b3
BLAKE2b-256 e815fcfe67988ffd8e6256363174ca78fca86c927f8e6e618fd178f95a97d4d6

See more details on using hashes here.

File details

Details for the file cowsay-4.0-py2.py3-none-any.whl.

File metadata

  • Download URL: cowsay-4.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 24.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for cowsay-4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2594b11d6624fff4bf5147b6bdd510ada54a7b5b4e3f2b15ac2a6d3cf99e0bf8
MD5 1828587b9728e0a3d10025853a34c0ef
BLAKE2b-256 b76538f31ef16efc312562f68732098d6f7ba3b2c108a4aaa8ac8ba673ee0871

See more details on using hashes here.

Supported by

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