{"library":"py-memoize","title":"py-memoize","description":"A caching library for asynchronous Python applications (asyncio-based) that handles dogpiling properly and provides a configurable & extensible API. Current version 3.1.1. Release cadence is irregular.","language":"python","status":"active","last_verified":"Mon Apr 27","install":{"commands":["pip install py-memoize"],"cli":null},"imports":["from memoize import Memoizer","from memoize.cache import ExpiringCache","from memoize.cache import InMemoryCache"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import asyncio\nfrom memoize import Memoizer\nfrom memoize.cache import InMemoryCache, ExpiringCache\n\nmemoizer = Memoizer(cache=InMemoryCache())\n\n@memoizer.cache(ttl=5)\nasync def fetch_data(key: str) -> str:\n    await asyncio.sleep(1)\n    return f\"data-{key}\"\n\nasync def main():\n    result = await fetch_data(\"my_key\")\n    print(result)\n\nasyncio.run(main())","lang":"python","description":"Basic usage: create a Memoizer with an in-memory cache and decorate an async function with ttl in seconds.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}