Skip to main content

temporal-cache

Time based function caching

Build Status codecov License PyPI

Install

From pip:

pip install temporal-cache

From conda:

conda install temporal-cache -c conda-forge

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.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 temporal-cache 0.1.6
File Size Uploaded Provenance
temporal_cache-0.1.6.tar.gz 14.9 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 33.6 kB

Release files / temporal_cache-0.1.6.tar.gz

Download URL temporal_cache-0.1.6.tar.gz
Size 14.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ad26a9b11d40fd168dec79890ab44ddf63ded6a37d500263454ffac7b6bdf224
BLAKE2b-256 checksum
How to use checksums
ecfb51fcb05f2de0d7d9cbe45426448848bb13ff7c5cea6481d43fe1e88907d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.11

Release files / temporal_cache-0.1.6-py3-none-any.whl

Download URL temporal_cache-0.1.6-py3-none-any.whl
Size 18.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1bdf8afca4422afadebdcbafc56e2453be2de5c466804cb586b92f357a91ca0c
BLAKE2b-256 checksum
How to use checksums
af5d6ef5ba0da67c39c8cefbd4f64be7069512316dffe441e078e892b3f4aed0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.11

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

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