Skip to main content

Decorator to cache function return values based on time.

Project description

timecache

Decorator to cache function return values based on time.

Install

pip3 install ftimecache

Usage

from ftimecache import ftimecache

@ftimecache(weeks=1, days=2, hours=3, minutes=4, seconds=5, milliseconds=6, microseconds=7)
def your_function(*args, **kwargs):
    # do something

# OR
from datetime import timedelta

@ftimecache(timedelta=timedelta(weeks=1, ...))
def your_function(*args, **kwargs):
    # do something

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ftimecache-0.0.2.tar.gz (2.5 kB view hashes)

Uploaded Source

Built Distribution

ftimecache-0.0.2-py3-none-any.whl (5.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page