Skip to main content

Seriously the cats ass. Seriously.

Project description

CatsAss

https://img.shields.io/pypi/v/CatsAss.svg

Seriously the cats ass. Seriously.

Now with Colors!

https://github.com/Duroktar/CatsAss/blob/master/images/CatsAss_colorz.png?raw=true

WTF is it?

CatsAss is the cats ass for sneaking cats into your daily workflow. the_cats_ass() introspects the function you call it from and returns the local variables PrettyPrinted with a Cat! Not only is the data PrettyPrinted, but you can also add syntax highlighting or create your own custom KittyPrinter classes!

So instead of this kinda stuff..

def cat_tail_shape_determiner_function(n):
    a, b = 0, 1
    rv = [a]
    while a < n:
       print('a:', a)
       print('b:', b)
       print('rv:', rv)
       a, b = a + b, b
       rv.append(a)
    return rv

Do this.

from catsass import the_cats_ass

def cat_tail_shape_determiner_function(n):
    a, b = 0, 1
    rv = [a]
    while a < n:
       print( the_cats_ass() )
       a, b = a + b, b
       rv.append(a)
    return rv

https://github.com/Duroktar/CatsAss/blob/master/images/CatsAss_demo.png?raw=true

It’s the cats ass!!

Colorz!

Requires: pygments and crayons packages

pip install pygments crayons

Just swap out the_cats_ass() with the color cat of your choice!

from catsass import tuxedo_cat

def TuxedoCat(n):
    its = [
        "The       ",
        " cats     ",
        "   ass..  ",
        "Seriously."
    ]
   print( tuxedo_cat() )  # See list below for more cats
https://github.com/Duroktar/CatsAss/blob/master/images/CatsAss_colorz_dark.png?raw=true

Available colored cats - calico_cat, tuxedo_cat

  • Minimum terminal width of 80 characters recommended

  • MIT licensed

Installation

Requires python 3.6

To install CatsAss, run this command in your terminal:

$ pip install CatsAss

To enable Color mode, install pygments and crayons as well:

$ pip install pygments crayons

If you don’t have pip installed, this Python installation guide can guide you through the process.

Customization

The catsass.PrettyKitty class can be used directly to produce your own color combinations or custom titles. In the next release you will be able to add your own ascii-art and coloring schemes yourself, for now we can only modify arguments. Here’s what’s available..

  • colors: set True to activate colorz

  • coat: ‘calico_colorz’ or ‘tuxedo_colors’

  • logo_colorz: ‘logo_colorz’ or ‘dark_logo_colorz’

  • title: Can be set to any string. defaults to “Meowed with love by Duroktar, 2017”

  • ctx: when used with the_cats_ass this is filled in with the name of the calling function. But any hashable object works.

  • data: the actual data you wish to be pretty-printed.

Example:

from catsass import PrettyKitty

data = {*zip('abcde', range(5))}

print(PrettyKitty("Magic!", data, colors=True, coat='tuxedo_colorz',
      logo_colorz='dark_logo_colorz', title="Dude, where's my car?"))

Bugs

CatsAss works by inspecting the stack frames, which isn’t always the right context. In this case it isn’t really the cats ass anymore.. Luckily you can poke the cat in different places until you get the context you want.

from catsass import the_cats_ass, comb, Cats


def long_cat_tail():
    def cat_tail_shape_determiner_function(n):
        a, b = 0, 1
        rv = [a]
        while a < n:
           print( poke_the_cat(Cats.TAIL, catnip=True) )
           a, b = a + b, b
           rv.append(a)
        return rv
    return cat_tail_shape_determiner_function(100)

Issues

Deep personal ones, yes.

Coding

Duroktar - duroktar@gmail.com

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

CatsAss-1.1.3.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

CatsAss-1.1.3-py36-none-any.whl (11.7 kB view details)

Uploaded Python 3.6

File details

Details for the file CatsAss-1.1.3.tar.gz.

File metadata

  • Download URL: CatsAss-1.1.3.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for CatsAss-1.1.3.tar.gz
Algorithm Hash digest
SHA256 360a645abf67d2f16dd27a380f8b2b3cb6fce6e923f3d72603aea812992f77b3
MD5 83ac48f346f7df0ee4da22280018843b
BLAKE2b-256 730f95ba0abc8c1151c14971cd1b8d1931e3bda3d940f72c9fd38c1fc457b6b3

See more details on using hashes here.

File details

Details for the file CatsAss-1.1.3-py36-none-any.whl.

File metadata

File hashes

Hashes for CatsAss-1.1.3-py36-none-any.whl
Algorithm Hash digest
SHA256 1ee4c16b51e8a410a530af387b9f943ed3dbda7532378569efc940bce025d4e9
MD5 70c0e586b4a2a6dc571aa824a7e79f9f
BLAKE2b-256 fe5c5fb96dce7d48bf7fad27f6311054aed2aed58eac0632981d729dd50c60b6

See more details on using hashes here.

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