Skip to main content

ttl-cache

How to use it

pip install ttl-cache
import ttl_cache


# use ttl_cache directly
@ttl_cache
def expensive_operation(a, b):
    ...
    ...
    return SOME_RESULT

expensive_operation(xx, yy)
expensive_operation(xx, yy)  # prefer cached result
# ... 60 seconds later
expensive_operation(xx, yy)  # compute again


# or
@ttl_cache(2.0)  # cache the result in the next 2 seconds, default is 60.0 seconds
def expensive_operation(a, b):
    ...
    ...

Metadata

Release files for ttl-cache 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 ttl-cache 1.6
File Size Uploaded Provenance Actions
ttl-cache-1.6.tar.gz 2.1 kB Without provenance Details for ttl-cache-1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ttl-cache 1.6
File Interpreter ABI Platform Actions
ttl_cache-1.6-py3-none-any.whl Python 3 none any Details for ttl_cache-1.6-py3-none-any.whl

Total release size: 4.5 kB

Release files / ttl-cache-1.6.tar.gz

Download URL ttl-cache-1.6.tar.gz
Size 2.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c4ce4af36d43aba549a357ab317a6191439d3b47bee166ef67b1d6b07a3effb5
BLAKE2b-256 checksum
How to use checksums
7944a78cecc906fd5b685727b1ad1b34193b93d66867261f3e68911a9f98b2d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release files / ttl_cache-1.6-py3-none-any.whl

Download URL ttl_cache-1.6-py3-none-any.whl
Size 2.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
061f30074480c4f9efd6e65a94f8b39dbe8e3c4e7aa330771233b29bae5e813f
BLAKE2b-256 checksum
How to use checksums
b768237ea3d3430655cd965c8b9852dcd133d15201c5ee6a07bb2247d43a5ec4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Security for ttl-cache 1.6

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.

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