Skip to main content
https://img.shields.io/travis/youngking/tlcache.svg https://img.shields.io/pypi/v/tlcache.svg

Two Level Local Cache

Usage

  • simple use

>>> from tlcache import TLCache
>>> cache = TLCache(cache_dir="/tmp/xxxxdir")
>>> lst = []
>>> @cache.cache()
... def apppend():
...     lst.append(1)
...     return lst
>>> append() == [1]
>>> append() == [1]
  • cache refresh

>>> with cache.with_refresh():
...     append() == [1, 1]
...     append() == [1, 1, 1]
>>> append() == [1, 1, 1]

Features

  • Two level cache, first level is memory, and second level is the filesystem

History

0.2.1 (2017-06-21)

  • Fix missing exception stack

0.2.0 (2016-08-07)

  • Even cache when got empty results

  • When exception, use old data to cache degraded

0.1.7 (2016-4-14)

  • cache refresh manager, should be used with lock

0.1.6 (2016-4-14)

  • add cache refresh context manager

0.1.5 (2016-4-14)

  • decrese logging warnings

0.1.4 (2016-3-16)

  • make sure fd is closed when fdopen occus exception

  • set memory before file

0.1.3 (2015-11-24)

  • Don’t cache when results is empty

0.1.2 (2015-11-13)

  • Fix a bug that which causes when cache invalidate wil not cached again.

0.1.1 (2015-11-10)

  • Inside the tlcache’s add method, use the filecache’s set method internally.

0.1.0 (2015-11-10)

  • First release on PyPI.

Metadata

Release files for tlcache 0.2.1

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

Source distribution (sdist)

Source distribution for tlcache 0.2.1
File Size Uploaded Provenance
tlcache-0.2.1.tar.gz 16.1 kB Without provenance Details

Release files / tlcache-0.2.1.tar.gz

Download URL tlcache-0.2.1.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6fd545023e81473334f57122be2022ce0025784919c10d3becb3cb5da519febb
BLAKE2b-256 checksum
How to use checksums
8b32a807719630785bb0de0cb1f3f10c74778e9113a0f6779773dbde714e38a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for tlcache 0.2.1

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