This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
=======
Deckor
=======

Decorate your functions and with 'deckor'ators. A module created while learning decorators.

Installation
=============

pip install deckor


Decorators Supported:
======================

* timer : Measure execution time of functions

@deckor.timer
def fact(x):
if x <= 0:
return 1
return x*fact(x-1)

* cacheit : Cache intermediate results

@deckor.cacheit
def fact(x):
if x <= 0:
return 1
return x*fact(x-1)

* trace : Print the pretty recursion trace

@deckor.trace
def fib(x):
if x < 2:
return x
return fib(x-1)+fib(x-2)

fib(10)

Now, try trace with cacheit

@deckor.cacheit
@deckor.trace
def fib(x):
if x < 2:
return x
return fib(x-1)+fib(x-2)

fib(10)

* with_retries : function signature: with_retries(tries=5, delay=0, increment=0). Try execution of function with retries. Retry'tries' no of times. Delay of 'delay' seconds between retries. Increase the delay by 'increment' between retries

@with_retries(5)
def random_f():
try: r = requests.get("random")
except: return

* syncronize : Provides very basic syncronization. Note: Not free from race condition only for basic usage

import threading

lock = threading.Lock()
sample_list = []

@deckor.syncronize(lock)
def sample(sample_list):
sample_list.append(1)

#sample list is modified only after lock is acquired
#so, mdification is sample_list os thread safe
Release History

Release History

0.0.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
deckor-0.0.1.tar.gz (2.3 kB) Copy SHA256 Checksum SHA256 Source Jun 7, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting