Metadata-Version: 2.1
Name: object-cache
Version: 0.1.6
Summary: This module caches the result of function.
Home-page: https://github.com/u-masao/object-cache
Author: u-masao
Author-email: 4973920+u-masao@users.noreply.github.com
Requires-Python: >=3.8,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Requires-Dist: cloudpickle (>=1.6.0,<2.0.0)
Project-URL: Repository, https://github.com/u-masao/object-cache
Description-Content-Type: text/x-rst

=====================
object_cache
=====================

description
============

This module caches the processing result of the function in the storage, and if the cache hits, skips the processing in the function and returns the result. Create ".object_cache" in the current path and cache it.

install
========

.. code-block:: shell

    pip install object-cache

code example
============

.. code-block:: python

    import time

    from object_cache import object_cache


    @object_cache
    def factorial(a):
        result = 1
        for i in range(2, a + 1):
            result *= i

        return result


    for _ in range(5):
        start = time.time()
        factorial(100000)
        print("elapsed time", time.time() - start)

clear cache
============

.. code-block:: shell

    rm -fr .object_cache


