temporal-cache
Time-based cache invalidation
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.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| temporal-cache-0.0.5.tar.gz | 7.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| temporal_cache-0.0.5-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 20.7 kB
Release files / temporal-cache-0.0.5.tar.gz
| Download URL | temporal-cache-0.0.5.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
835dca1fb821cf98c7cf5edc576031ef234d062acb44b63129cc37f87790ea67
|
|
BLAKE2b-256 checksum How to use checksums |
e16743e0ffcf72f54c6c2c04d830b1fad017526823a315ea213be8452bcc67b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/0.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.5
|
Release files / temporal_cache-0.0.5-py2.py3-none-any.whl
| Download URL | temporal_cache-0.0.5-py2.py3-none-any.whl |
|---|---|
| Size | 13.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
8386d1f66bc81c80814ac530b1025a437bbf075ce75535be70ef870b2cdbd20a
|
|
BLAKE2b-256 checksum How to use checksums |
e27ad06344ea5c61c6e76e16b55c8db660e9b9da37da12d6ff622193eaf4b653
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/0.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.5
|