Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

TTL Cache

PyPI - Version PyPI - Python Version CI codecov Docs

An LRU cache decorator with a time to live like functools.lru_cache, but entries expire after a configurable number of seconds.

Installation

pip install ttl-cache-decorator

Usage

from ttl_cache import ttl_lru_cache


@ttl_lru_cache(ttl=30)
def fetch_user(user_id: int) -> dict:
    return {"id": user_id, "name": "Ada"}


fetch_user(1)  # Calls the function
fetch_user(1)  # Cache hit
# ... 30 seconds later ...
fetch_user(1)  # Expired — calls the function again

License

ttl-cache-decorator is distributed under the terms of the MIT license.

Metadata

Release files for ttl-cache-decorator 0.1.6rc1

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-decorator 0.1.6rc1
File Size Uploaded Provenance Actions
ttl_cache_decorator-0.1.6rc1.tar.gz 131.9 kB With provenance Details for ttl_cache_decorator-0.1.6rc1.tar.gz

Built distribution (wheel)

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

Total release size: 136.1 kB

Release files / ttl_cache_decorator-0.1.6rc1.tar.gz

Download URL ttl_cache_decorator-0.1.6rc1.tar.gz
Size 131.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a93e0e6f1bfebbce6aaac7b8d83deaaaa5aefee9c6568e1c88b9e7aefff9e7c6
BLAKE2b-256 checksum
How to use checksums
f614d2ccd80a18528f0fa0e3d7136c2ddce10930df718408f2e9431017da9bf6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Release files / ttl_cache_decorator-0.1.6rc1-py3-none-any.whl

Download URL ttl_cache_decorator-0.1.6rc1-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a4a1bcd8cad19607bf43d58e992ff25dbbe0cd036b0d6cce7da57a4251e90309
BLAKE2b-256 checksum
How to use checksums
6476e1f662394f8cc1c53110f084cef50a4d60bc68b68cd6b5d96b9c3a46af57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Security for ttl-cache-decorator 0.1.6rc1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ttl_cache_decorator-0.1.6rc1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

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