Skip to main content

temporal-cache

Time-based cache invalidation

Build Status Coverage BCH compliance License PyPI Docs

Install

From pip

pip install temporal-cache

Or from source

python setup.py install

Why?

I needed something that would automagically refresh at 4:00pm when markets close.

    @expire(hour=16)
    def fetchFinancialData():

Interval Cache

The interval cache expires every time interval since its first use

    @interval(seconds=5, minutes=2)
    def myfoo():
        '''myfoo's lru_cache will expire 2 minutes, 5 seconds after last use'''

Expire Cache

The expire cache expires on the time given, in scheduler/cron style.

    @expire(second=5, minute=2)
    def myfoo():
        '''myfoo's lru_cache will expire on the second minute, fifth second of every hour, every day, etc'''

Caveats

Python hashing symantics persist. Dicts will be frozen, lists will be converted to tuples. Users are advised to pre-freeze to avoid issues.

Metadata

Release files for temporal-cache 0.1.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 temporal-cache 0.1.1
File Size Uploaded Provenance Actions
temporal-cache-0.1.1.tar.gz 14.3 kB Without provenance Details for temporal-cache-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for temporal-cache 0.1.1
File Interpreter ABI Platform Actions
temporal_cache-0.1.1-py2.py3-none-any.whl Python 2, Python 3 none any Details for temporal_cache-0.1.1-py2.py3-none-any.whl

Total release size: 31.8 kB

Release files / temporal-cache-0.1.1.tar.gz

Download URL temporal-cache-0.1.1.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7a71d68537f1f51991adcdba2ad79cf0f9d78d1b26f14090ce56054d18ef2c78
BLAKE2b-256 checksum
How to use checksums
e24768dfcd0cad6e9067b4adb29d3f7d34fcd1045488dcce4fe01f507dc1b248
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.6.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.5

Release files / temporal_cache-0.1.1-py2.py3-none-any.whl

Download URL temporal_cache-0.1.1-py2.py3-none-any.whl
Size 17.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
41ea70ee92edb69af183af264ac4e341f3317098fa4a7bd51ed11726262fc11a
BLAKE2b-256 checksum
How to use checksums
3373486062b336bf4146e0914f72fff0257883b1b97aee098c8bd879e0037490
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.6.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.5

Security for temporal-cache 0.1.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