{"id":20553580,"url":"https://github.com/mrtj/chainedcache","last_synced_at":"2026-06-06T15:31:49.413Z","repository":{"id":69169624,"uuid":"338049339","full_name":"mrtj/chainedcache","owner":"mrtj","description":"Simple python cache","archived":false,"fork":false,"pushed_at":"2021-02-11T17:28:05.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-16T17:30:30.963Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrtj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"publiccode":null,"codemeta":null}},"created_at":"2021-02-11T14:17:31.000Z","updated_at":"2021-05-07T20:30:03.000Z","dependencies_parsed_at":"2023-07-12T13:00:30.545Z","dependency_job_id":null,"html_url":"https://github.com/mrtj/chainedcache","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrtj%2Fchainedcache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrtj%2Fchainedcache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrtj%2Fchainedcache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrtj%2Fchainedcache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrtj","download_url":"https://codeload.github.com/mrtj/chainedcache/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242157375,"owners_count":20081052,"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":[],"created_at":"2024-11-16T02:42:30.094Z","updated_at":"2026-06-06T15:31:49.168Z","avatar_url":"https://github.com/mrtj.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chainedcache\n\nSimple python cache system.\n\n## Installation\n\n```bash\n$ python -m pip install git+https://github.com/mrtj/chainedcache\n```\n\n## Usage\n\n```python\nimport json\nfrom chainedcache import DictCache, FileCache, S3Cache, ChainedCache\n\njson2bytes = lambda d: json.dumps(d).encode('UTF-8')\nbytes2json = lambda d: json.loads(d.decode('UTF-8'))\nstream2json = lambda d: json.load(d)\n\ndict_cache = DictCache()\n\nfile_cache = FileCache('./cache', mode='bytes', \n                       put_transformer=json2bytes, get_transformer=bytes2json)\n\ns3_cache = S3Cache('my_s3_bucket', 'cache', region='us-east-1', \n                   put_transformer=json2bytes, get_transformer=stream2json)\n\ncache = ChainedCache([dict_cache, file_cache, s3_cache])\n\ndef data_generator(key):\n    return { \"the_key_is\": key }\n\njson_data = cache.get_put(\"hello\", data_generator)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrtj%2Fchainedcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrtj%2Fchainedcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrtj%2Fchainedcache/lists"}