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

Klepto extends python’s ‘lru_cache’ to utilize different keymaps and alternate caching algorithms, such as ‘lfu_cache’ and ‘mru_cache’. While caching is meant for fast access to saved results, klepto also has archiving capabilities, for longer-term storage. Klepto uses a simple dictionary-sytle interface for all caches and archives, and all caches can be applied to any python function as a decorator. Keymaps are algorithms for converting a function’s input signature to a unique dictionary, where the function’s results are the dictionary value. Thus for y = f(x), y will be stored in cache[x] (e.g. {x:y}).

Klepto provides both standard and ‘safe’ caching, where safe caches are slower but can recover from hashing errors. Klepto is intended to be used for distributed and parallel computing, where several of the keymaps serialize the stored objects. Caches and archives are intended to be read/write accessible from different threads and processes. Klepto enables a user to decorate a function, save the results to a file or database archive, close the interpreter, start a new session, and reload the function and it’s cache.

Klepto is part of pathos, a python framework for heterogenous computing. Klepto is in the early development stages, and any user feedback is highly appreciated. Contact Mike McKerns [mmckerns at caltech dot edu] with comments, suggestions, and any bugs you may find. A list of known issues is maintained at http://dev.danse.us/trac/pathos/query.

Major Features

Klepto has standard and ‘safe’ variants of the following:

- 'lfu_cache' - the least-frequently-used caching algorithm
- 'lru_cache' - the least-recently-used caching algorithm
- 'mru_cache' - the most-recently-used caching algorithm
- 'rr_cache' - the random-replacement caching algorithm
- 'no_cache' - a dummy caching interface to archiving
- 'inf_cache' - an infinitely-growing cache

Klepto has the following archive types:

- 'file_archive' - a dictionary-style interface to a file
- 'dir_archive' - a dictionary-style interface to a folder of files
- 'sqltable_archive' - a dictionary-style interface to a sql database table
- 'sql_archive' - a dictionary-style interface to a sql database
- 'dict_archive' - a dictionary with an archive interface
- 'null_archive' - a dictionary-style interface to a dummy archive

Klepto provides the following keymaps:

- 'keymap' - keys are raw python objects
- 'hashmap' - keys are a hash for the python object
- 'stringmap' - keys are the python object cast as a string
- 'picklemap' - keys are the serialized python object

Klepto also includes a few useful decorators providing:

- simple, shallow, or deep rounding
- cryptographic key generation, with masking of selected arguments

Current Release

The latest release version is klepto-0.1.2. You can download it here. The latest stable version of klepto is always available at:

http://dev.danse.us/trac/pathos

Development Release

If you like living on the edge, and don’t mind the promise of a little instability, you can get the latest development release with all the shiny new features at:

http://dev.danse.us/packages.

Installation

Klepto is packaged to install from source, so you must download the tarball, unzip, and run the installer:

[download]
$ tar -xvzf klepto-0.1.2.tgz
$ cd klepto-0.1.2
$ python setup py build
$ python setup py install

You will be warned of any missing dependencies and/or settings after you run the “build” step above.

Alternately, klepto can be installed with easy_install:

[download]
$ easy_install -f . klepto

Requirements

Klepto requires:

- python, version >= 2.5, version < 3.0
- dill, version >= 0.2.5
- pox, version >= 0.2.2

Optional requirements:

- sqlalchemy, version >= 0.8.4
- setuptools, version >= 0.6

Usage Notes

Probably the best way to get started is to look at the tests that are provide within klepto. See klepto.tests for a set of scripts that test klepto’s caching and archiving functionalities. Klepto’s source code is also generally well documented, so further questions may be resolved by inspecting the code itself.

License

Klepto is distributed under a 3-clause BSD license.

>>> import klepto
>>> print klepto.license()

Citation

If you use klepto to do research that leads to publication, we ask that you acknowledge use of klepto by citing the following in your publication:

Michael McKerns and Michael Aivazis,
"pathos: a framework for heterogeneous computing", 2010- ;
http://dev.danse.us/trac/pathos

More Information

Please see http://dev.danse.us/trac/pathos for further information.

Release History

Release History

0.1.2

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

0.1.1

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

0.1

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
klepto-0.1.2.tgz (61.5 kB) Copy SHA256 Checksum SHA256 Source Feb 6, 2016
klepto-0.1.2.zip (79.3 kB) Copy SHA256 Checksum SHA256 Source Feb 6, 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