{"id":26985782,"url":"https://github.com/calpaterson/pyappcache","last_synced_at":"2025-06-28T13:33:22.676Z","repository":{"id":62578668,"uuid":"272490900","full_name":"calpaterson/pyappcache","owner":"calpaterson","description":"A library for application-level caching","archived":false,"fork":false,"pushed_at":"2024-04-05T10:45:28.000Z","size":163,"stargazers_count":21,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-22T18:03:53.410Z","etag":null,"topics":["cache","library"],"latest_commit_sha":null,"homepage":"https://pyappcache.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/calpaterson.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-06-15T16:34:18.000Z","updated_at":"2024-12-29T11:06:31.000Z","dependencies_parsed_at":"2024-03-26T14:37:30.903Z","dependency_job_id":null,"html_url":"https://github.com/calpaterson/pyappcache","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calpaterson%2Fpyappcache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calpaterson%2Fpyappcache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calpaterson%2Fpyappcache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calpaterson%2Fpyappcache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/calpaterson","download_url":"https://codeload.github.com/calpaterson/pyappcache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247057148,"owners_count":20876522,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache","library"],"created_at":"2025-04-03T18:34:25.006Z","updated_at":"2025-04-03T18:34:26.818Z","avatar_url":"https://github.com/calpaterson.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"pyappcache\n==========\n\nPyappcache is a library to make it easier to use application-level\ncaching in Python.\n\n-  Allows putting arbitrary Python objects into the cache\n-  Uses PEP484 type hints to help you typecheck cache return values\n-  Supports Memcache, Redis and SQLite\n-  Supports working as a \"read-through\" and \"write-through\" cache\n-  Native support for key `\"namespacing\" \u003chttps://github.com/memcached/memcached/wiki/ProgrammingTricks#namespacing\u003e`__\n-  Provides a few handy extras\n\n   -  A plugin for the\n      `cachecontrol \u003chttps://pypi.org/project/CacheControl/\u003e`__ library\n      so you can also use it as an HTTP cache with\n      `requests \u003chttps://pypi.org/project/requests/\u003e`__\n\nA simple example\n----------------\n\n.. code:: python\n\n    from datetime import date\n\n    from pyappcache.redis import RedisCache\n    from pyappcache.keys import Key, SimpleStringKey\n\n    cache = RedisCache()\n\n    # Annotate the type here to let mypy know this key is used for dates\n    key: Key[date] = SimpleStringKey(\"mifid start date\")\n    cache.set(key, date(2018, 1, 3), ttl_seconds=3600)\n\n    ... # later...\n\n    # This variable's type will be inferred as datetime.date\n    special_date = cache.get(key)\n\n\nHow it compares to alternatives\n-------------------------------\n\nUsing the redis/memcache/sqlite client directly\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n- Explicit key objects allow for type inference and encapsulation of keying\n- Keys are prefix to help prevent collisions\n- Optional, pluggable, compression\n- Hopefully the overhead is small (not yet tested!)\n- Portable between redis/memcache/sqlite, etc\n\ndogpile.cache\n~~~~~~~~~~~~~\n\n- Explicit key objects allow for type inference and encapsulation of keying\n- dogpile.cache provides locking, pyappcache does not\n- Reduced temptation to use the problematic decorator pattern\n  - This often causes import order problems as you need to have your cache at import time\n- Pyappache doesn't provide DBM/file backends, SQLite instead\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalpaterson%2Fpyappcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcalpaterson%2Fpyappcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalpaterson%2Fpyappcache/lists"}