Skip to main content

A way to speed up debugging and testing.

Project description

Note. This is Alpha software, use with caution.

A cache meant to speed up debugging and testing process. Stores intermediate results in files.

Installation

pip install debug-cache

Usage

from debug_cache import DebugCache
cache = DebugCache(path='/path/to/debug_cache')

# or just use default
from debug_cache import cache

First debug_cache usage is to fasten repeated and heavy calls to tighten edit/rerun loop:

@cache.cached
def some_function(x, y):
    # do something
    return res

Second debug_cache usage is to check that function results didn’t change. Useful when refactoring or optimizing:

# Check that function results didn't change, they need to be cached first
@cache.checked
def some_function(x, y):
    # ...

# Same, but cache first time, check all subsequent ones
@cache.checked(strict=False)
def some_function(x, y):
    # ...

This will stop and start debugger if function results don’t match ones saved earlier. Strict version also stops if no cached results are found.

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

debug-cache-0.0.1.tar.gz (6.0 kB view details)

Uploaded Source

File details

Details for the file debug-cache-0.0.1.tar.gz.

File metadata

File hashes

Hashes for debug-cache-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f75729ce62913fc47c378eb1beb14360644f229550ea3b0f8507d4a0a4106acf
MD5 9900c2c67e1c256fccf71f3fab7e08ff
BLAKE2b-256 af0d6633b108a167a6087919a071ef28ea7f1d48fc76a17fc8e93197d90b56b4

See more details on using hashes here.

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