Giter Club home page Giter Club logo

slippery's Introduction

Slippery - collections of useful decorators for different phases of development software. Your code seems works slowly and you have not any idea why it's happen and how to check it? Function returns crazily structured data and you can't find what you need? So, Slippery Stair help with all this problems and another ones. Just decorate function which you need and take a look at result.

Installation

โžœ  pip install slippery

Usage

For using this library you need to pay 25 schmeckles.

export SCHMECKLES=25

Actually you can use it without paying schmeckles, but... come on! 25 schmeckles for Slippery Stair? Easily!

Now, seriously

Sometime we need to check out execution time of some function. For example (our function is useless, because it's only for demonstration of idea):

import slippery

@slippery.execution_time
def generator(no=True, maximum=100, registry=None):
    if True:
        do_something()

    if not registry:
        update_something()

    result = [
        k for k in [
            i for i in range(maximum)
        ]
    ]

    return result
    
if __name__ == '__main__':
    generator(True, 100, [1, 2, 3])

Result:

When you need more information than returns @execution_time decorator, then you should use decorator @efficiency:

@slippery.efficiency
def generator(*args, **kwargs):
    # ...

Result:

Also you can disassemble function using decorator @disassemble:

@slippery.disassemble
def generator(maximum=1000):
    result = [
        k for k in [
            i for i in range(20)
        ]
    ]
    result.append([x for x in 'SMAP'])

    return result	

Result:

Disclaimer

Slippery is developed only for developers and only for debugging and testing phases. This library should not used in production, if you don't want unacceptable behaviour of your application.

Thanks

This library is originally inspired by character (Slippery Stair) from Rick and Morty. Special thanks for Mark Lutz and Luciano Romalho for great books about Python.

slippery's People

Contributors

lk-geimfari avatar rezemika avatar swapsha96 avatar virresh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.