Skip to main content

funkycache

funkycache is a disk-backed cache for Python functions that tracks file dependencies. I use it in my static site generator to cache the output of expensive functions.

Example:

from funkycache import FunkyCache

cache = FunkyCache(storage="sqlite")


@cache.register(files=["content/index.md", "templates/base.html"])
def render_index() -> str:
    page = Path("content/index.md").read_text()
    template = Path("templates/base.html").read_text()
    return template.replace("{{ content }}", page)


print(render_index())  # runs the function
print(render_index())  # cache hit, even in a new process

cache.notify_path_change("content/index.md")

print(render_index())  # runs the function again

When you register a function with funkycache, you can declare path or static values the function depends on. If those dependent values change, the function's cache is invalidated, and the next call will rerun the function fresh.

Note: funkycache does not watch the filesystem. It is your responsibility to notify it of changes to dependent files, or they will be noticed when the Python process restarts.

Installation

Install using pip:

$ pip install funkycache

License

This project is shared under the MIT license.

Metadata

Release files for funkycache 1.0.0

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

Source distribution (sdist)

Source distribution for funkycache 1.0.0
File Size Uploaded Provenance Actions
funkycache-1.0.0.tar.gz 18.1 kB Without provenance Details for funkycache-1.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 30.1 kB

Release files / funkycache-1.0.0.tar.gz

Download URL funkycache-1.0.0.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d706712d2f999e9925617bc973eb7ddc271a16745ba629cc61b20004796dc367
BLAKE2b-256 checksum
How to use checksums
f3dcc91cd2daa774be2958b8ce84c2e70996f21da1543b8d35855ea483775940
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / funkycache-1.0.0-py3-none-any.whl

Download URL funkycache-1.0.0-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c25d1620e2a53a237ad423a0f8b43c89f9a7f6696dea2dae3a2e819f46707524
BLAKE2b-256 checksum
How to use checksums
64d8e38bb61f399367b1c013b741547f75f66385226401841e2f059c327cd746
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for funkycache 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

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