Skip to main content

advanced memoization/caching of functions with data analytics in mind

Project description

KEEP IT

This is a WORK IN PROGRESS.

keepit provides advanced memoization to disk for functions. In other words, it records the results of important functions between executions.

keepit saves the results of calling a function to disk, so calling the function with the exact same parameters will re-use the stored copy of the results, leading to much faster times.

Example usage:

import pandas as pd
from keepit import keepit

@keepit('myresults.tsv')
def expensive_function(number=1):
    df = pd.DataFrame()
    # Perform a really expensive operation, maybe access to disk?
    return df

# When a results file for the function does not exist
# this may take a long time
expensive_function(number=1)
# Now a myresults.tsv_{some hash) has been generated

# This is almost instantaneous:
expensive_function(number=1)

# Files are specific to each parameter execution, 
# so this will again take a long time:
expensive_function(number=42)
# After this, we should have two files, one for number=1, 
# and another one for number=42.

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

keepit-0.2.2.tar.gz (13.4 kB view hashes)

Uploaded Source

Built Distribution

keepit-0.2.2-py3-none-any.whl (13.8 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