Skip to main content

rememberer

Rememberer is a tool to help your functions remember their previous results.

The advantage of this package compared to other memoization packages is that it will remember the result of the function even if you kill the program and restart it.

It will also remember the result even if you restart the python interpreter because it uses a pickle file to store the results.

Installation

pip install rememberer

Usage

from rememberer import rem

def add(a, b):
    import time
    time.sleep(3)
    return a + b

rem(add, 1, b=2)  # this will take 3 seconds
rem(add, 1, b=2)  # this will take ~0 seconds

You can use it as a decorator as well:

from rememberer import rem_dec

@rem_dec
def add(a, b):
    import time
    time.sleep(3)
    return a + b

add(1, b=2)  # this will take 3 seconds
add(1, b=2)  # this will take ~0 seconds

If you want to clear the cache, you can use the forget method:

from rememberer import forget

forget(add, 1, b=2)

Metadata

Release files for rememberer 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rememberer 0.1.6
File Size Uploaded
rememberer-0.1.6.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rememberer 0.1.6
File Interpreter ABI Platform
rememberer-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 8.4 kB

Release files / rememberer-0.1.6.tar.gz

Download URL rememberer-0.1.6.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f223acf28c07076dd526368da4f037f7f674ad82915e13fe20657bdf873b514b
BLAKE2b-256 checksum
How to use checksums
b020d791872b5202f0cc2a330b88a63cbafc490a1fc68273f9d5900fb77d2902
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Release files / rememberer-0.1.6-py3-none-any.whl

Download URL rememberer-0.1.6-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d77e29be21f5b5bcdc035cb6fb0668125ae243a5efb2fc18cb03f4a833210bb
BLAKE2b-256 checksum
How to use checksums
3583081e721ef8d65ce9d19afc36395ef5812aef801251397175b906f85b0bfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page