Decorator
Sometimes inside a decorator that creates a function with a generic (*args, **kwargs) signature, you want to access a value passed for a particular parameter name to a wrapped function, but don't know whether that value will be passed as a positional or keyword argument, or whether the wrapped...
Platforms: Windows, Mac, *nix, Python, BSD Solaris
License: Freeware | Download (52): Finding the value passed to a function by name Download |
This one-line decorator call adds caching to functions with hashable arguments and no keyword arguments.When the maximum size is reached, the least recently used entry is discarded -- appropriate for long-running processes which cannot allow caches to grow without bound. Includes built-in...
Platforms: Windows, Mac, *nix, Python, BSD Solaris
License: Freeware | Download (51): LRU cache decorator Download |
This simple decorator is different to other memoize decorators in that it will only cache results for a period of time. It also provides a simple method of cleaning the cache of old entries via the .collect method. This will help prevent excessive or needless memory consumption.
Platforms: Windows, Mac, *nix, Python, BSD Solaris
License: Freeware | Download (51): Memoize Decorator with Timeout Download |
Defining a property involves the definition of nested functions for one or more of fget,fset,fdel. The decorator probes the decorated function, captures its locals() just before it returns and looks for the names "fget", "fset" and "fdel". The found values, along with the function's docstring are...
Platforms: Windows, Mac, *nix, Python, BSD Solaris
License: Freeware | Download (51): Property decorator for python Download |
A set of utilities for the use of decorators in a Java web application. The goal of this project is to offer an easy way to 'decorate' data for presentation purposes. This is partially done by using concepts introduced by the Decorator Design Pattern.
Platforms: Windows, Mac, Linux
License: Freeware | Size: 652.17 KB | Download (51): Decorator Utilities Download |
This script shows you to use the new decorator feature of python 2.4 to systematically check the argument types for type-sensitive functions.
Platforms: Windows, Mac, *nix, Python, BSD Solaris
License: Freeware | Download (51): Type checked argument lists with decorators Download |
This script introduces weakly-bound methods. You could use this decorator to create methods that weakly-reference their instance (im_self). This means that the method itself will not keep the object alive. Useful for callbacks, caches, and avoiding cyclic references.
Platforms: Windows, Mac, *nix, Python, BSD Solaris
License: Freeware | Download (51): Weakmethod Script Download |
This script presents a way to introduce proper attribute access protection levels using a generic proxy object. By default all attributes are "protected" in the C sense and can be declared as public using either a function decorator or a class attribute.
Platforms: Windows, Mac, *nix, Python, BSD Solaris
License: Freeware | Download (49): Public and protected attribute access Download |
Django honeypot field utilities django-honeypot is a Django plugin that provides utilities for preventing automated form spam. Provides template tags, view decorators, and middleware to add and verify honeypot fields to forms. Installation To install run python setup.py install which will...
Platforms: *nix
License: Freeware | Size: 10.24 KB | Download (48): django-honeypot Download |
It can help create large sites consisting of many pages where a consistent look, navigation and layout is necessary.The application intercepts requests to any static or dynamically generated HTML page requested through the web-server, parses the page, obtains properties and data from the content...
Platforms: Java
License: Freeware | Size: 7.1 MB | Download (47): SiteMesh Download |
A dingus is sort of like a mock object. The main difference is that you don't set up expectations ahead of time. You just run your code, using a dingus in place of another object or class, and it will record what happens to it. Then, once your code has been exercised, you can make assertions...
Platforms: *nix
License: Freeware | Size: 10.24 KB | Download (46): dingus Download |
mock provides a core mock.Mock class that is intended to reduce the need to create a host of trivial stubs throughout your test suite. After performing an action, you can make assertions about which methods / attributes were used and arguments they were called with. You can also specify return...
Platforms: *nix
License: Freeware | Size: 10.24 KB | Download (42): contextdecorator Download |
A decorator to interact with argparse based on function signature. This is a decorator library that helps one to write small scripts in Python. There are three main features that it provides: * Automatically running a function when a script is called directly, but not when it is included as...
Platforms: *nix
License: Freeware | Size: 10.24 KB | Download (41): entrypoint Download |
The new features in unittest for Python 2.7 backported to Python 2.3+. unittest2 is a backport of the new features added to the unittest testing framework in Python 2.7. It is tested to run on Python 2.4 - 2.7. Thanks to Mark Roddy, there is also a version of for Python 2.3. This is maintained...
Platforms: *nix
License: Freeware | Size: 61.44 KB | Download (41): unittest2 Download |
A Python-to-Vim bridge decorator that allows transparent calls to Python functions in native Vim scripts. * Read more vim_bridge is a Python-to-Vim bridge decorator that allows transparent calls to Python functions in native Vim scripts. The following data types have proven to work: * Strings...
Platforms: *nix
License: Freeware | Size: 10.24 KB | Download (40): vim_bridge Download |
RPC4Django is an XMLRPC and JSONRPC server for Django powered projects. Simply plug it into any existing Django project and you can make your methods available via XMLRPC and JSONRPC. In addition, it can display nice documentation about the methods it makes available in a more customizable way...
Platforms: *nix
License: Freeware | Size: 20.48 KB | Download (40): RPC4Django Download |
Easylogger is a Python package which wraps aspects of original logging module in simple and Pythonic way. You can use all power of the original package with the new facilities side-by-side. The key features of current version of easylogging package are: Easy to start logging without...
Platforms: *nix
License: Freeware | Size: 81.92 KB | Download (40): Easylogger Download |
The Pytools package is like a big bag of things that are "missing" from the Python standard library. This is mainly a dependency of my other software packages, and is probably of little interest to you unless you use those. If you???*a*?re curious nonetheless, here???*a*?s what???*a*?s on offer:...
Platforms: *nix
License: Freeware | Size: 40.96 KB | Download (39): Pytools Download |
pyroutes is a really small wrapper for rapid development of small Python web applications. Why? I got tired of dealing with the same boring WSGI-stuff everytime I wanted to make a small web-utility in django, but I didn't want to go to far away from it, so I made this little thing to ease the...
Platforms: *nix
License: Freeware | Size: 10.24 KB | Download (39): pyroutes Download |
Xmpp/jabber bot framework makes implementation of your jabber bot straightforward and quick. pyjabberbot is a fork of python-jabberbot with focus on overall stability and availability of the bot. Features: * fault tolerance * connection monitoring, auto-reconnect * command handling...
Platforms: *nix
License: Freeware | Size: 20.48 KB | Download (39): pyjabberbot Download |