Metadata-Version: 2.0
Name: db-cache
Version: 0.1.2
Summary: database caching for dynamic programming
Home-page: https://github.com/bchiang2/db_cache
Author: Benjamin Chiang
Author-email: aroy@alum.mit.edu
License: MIT license
Keywords: db_cache
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Requires-Dist: psycopg2

===============================
DB Cache
===============================


.. image:: https://img.shields.io/pypi/v/db_cache.svg
        :target: https://pypi.python.org/pypi/db_cache

.. image:: https://img.shields.io/travis/bchiang2/db_cache.svg
        :target: https://travis-ci.org/bchiang2/db_cache

.. image:: https://readthedocs.org/projects/db-cache/badge/?version=latest
        :target: https://db-cache.readthedocs.io/en/latest/?badge=latest
        :alt: Documentation Status

.. image:: https://pyup.io/repos/github/bchiang2/db_cache/shield.svg
     :target: https://pyup.io/repos/github/bchiang2/db_cache/
     :alt: Updates


database caching for dynamic programming


* Free software: MIT license
* Documentation: https://db-cache.readthedocs.io.

Intro
--------


Guide
--------
TL;DR

    .. code-block:: python

        import db_cache

        # Instantiate cache object that connects to PostgreSQL with provided credential
        cache = db_cache.Cache(database="db_name", user="admin", password="12345", host="localhost")

        # Create decorater that cache function result using provided table name
        @cache.use_table("some_table_name")
        def some_expensive_function(large_int):
            prime1, prime2 = factoring(large_int)
            return (prime1, prime2)

        # Return cached value if possible, otherwise compute and cache result. 
        some_expensive_function(121103)


Features
--------

* TODO

Credits
---------

This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage



=======
History
=======

0.1.0 (2016-11-04)
------------------

* First release on PyPI.


