%global _empty_manifest_terminate_build 0 Name: python-temporal-cache Version: 0.1.4 Release: 1 Summary: Time based function caching License: Apache 2.0 URL: https://github.com/timkpaine/temporal-cache Source0: https://mirrors.nju.edu.cn/pypi/web/packages/0f/6c/792cc73744d87d49e343f47cf552bffd3ebfb9019a37c68e7fe4a4c66c4d/temporal-cache-0.1.4.tar.gz BuildArch: noarch Requires: python3-frozendict Requires: python3-tzlocal Requires: python3-black Requires: python3-bump2version Requires: python3-flake8 Requires: python3-flake8-black Requires: python3-mock Requires: python3-pytest Requires: python3-pytest-cov Requires: python3-Sphinx Requires: python3-sphinx-markdown-builder Requires: python3-frozendict Requires: python3-tzlocal %description # temporal-cache Time-based cache invalidation [![Build Status](https://github.com/timkpaine/temporal-cache/workflows/Build%20Status/badge.svg?branch=main)](https://github.com/timkpaine/temporal-cache/actions?query=workflow%3A%22Build+Status%22) [![Coverage](https://codecov.io/gh/timkpaine/temporal-cache/branch/main/graph/badge.svg?token=ag2j2TV2wE)](https://codecov.io/gh/timkpaine/temporal-cache) [![License](https://img.shields.io/github/license/timkpaine/temporal-cache.svg)](https://pypi.python.org/pypi/temporal-cache/) [![PyPI](https://img.shields.io/pypi/v/temporal-cache.svg)](https://pypi.python.org/pypi/temporal-cache/) [![Docs](https://img.shields.io/readthedocs/temporal-cache.svg)](https://temporal-cache.readthedocs.io) ## 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. ```python3 @expire(hour=16) def fetchFinancialData(): ``` ## Interval Cache The interval cache expires every `time` interval since its first use ```python3 @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. ```python3 @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. %package -n python3-temporal-cache Summary: Time based function caching Provides: python-temporal-cache BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-temporal-cache # temporal-cache Time-based cache invalidation [![Build Status](https://github.com/timkpaine/temporal-cache/workflows/Build%20Status/badge.svg?branch=main)](https://github.com/timkpaine/temporal-cache/actions?query=workflow%3A%22Build+Status%22) [![Coverage](https://codecov.io/gh/timkpaine/temporal-cache/branch/main/graph/badge.svg?token=ag2j2TV2wE)](https://codecov.io/gh/timkpaine/temporal-cache) [![License](https://img.shields.io/github/license/timkpaine/temporal-cache.svg)](https://pypi.python.org/pypi/temporal-cache/) [![PyPI](https://img.shields.io/pypi/v/temporal-cache.svg)](https://pypi.python.org/pypi/temporal-cache/) [![Docs](https://img.shields.io/readthedocs/temporal-cache.svg)](https://temporal-cache.readthedocs.io) ## 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. ```python3 @expire(hour=16) def fetchFinancialData(): ``` ## Interval Cache The interval cache expires every `time` interval since its first use ```python3 @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. ```python3 @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. %package help Summary: Development documents and examples for temporal-cache Provides: python3-temporal-cache-doc %description help # temporal-cache Time-based cache invalidation [![Build Status](https://github.com/timkpaine/temporal-cache/workflows/Build%20Status/badge.svg?branch=main)](https://github.com/timkpaine/temporal-cache/actions?query=workflow%3A%22Build+Status%22) [![Coverage](https://codecov.io/gh/timkpaine/temporal-cache/branch/main/graph/badge.svg?token=ag2j2TV2wE)](https://codecov.io/gh/timkpaine/temporal-cache) [![License](https://img.shields.io/github/license/timkpaine/temporal-cache.svg)](https://pypi.python.org/pypi/temporal-cache/) [![PyPI](https://img.shields.io/pypi/v/temporal-cache.svg)](https://pypi.python.org/pypi/temporal-cache/) [![Docs](https://img.shields.io/readthedocs/temporal-cache.svg)](https://temporal-cache.readthedocs.io) ## 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. ```python3 @expire(hour=16) def fetchFinancialData(): ``` ## Interval Cache The interval cache expires every `time` interval since its first use ```python3 @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. ```python3 @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. %prep %autosetup -n temporal-cache-0.1.4 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-temporal-cache -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Fri May 05 2023 Python_Bot - 0.1.4-1 - Package Spec generated