{"id":15769944,"url":"https://github.com/etienne-napoleone/poche","last_synced_at":"2025-03-31T11:24:51.107Z","repository":{"id":54439372,"uuid":"231018190","full_name":"etienne-napoleone/poche","owner":"etienne-napoleone","description":"🎒 Simple and fast Python in-memory caching library","archived":false,"fork":false,"pushed_at":"2021-02-18T11:11:05.000Z","size":192,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-12T09:26:27.882Z","etag":null,"topics":["cache","fast","in-memory","library","python","simple"],"latest_commit_sha":null,"homepage":"","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/etienne-napoleone.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}},"created_at":"2019-12-31T03:21:14.000Z","updated_at":"2021-12-20T23:30:57.000Z","dependencies_parsed_at":"2022-08-13T15:40:51.237Z","dependency_job_id":null,"html_url":"https://github.com/etienne-napoleone/poche","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etienne-napoleone%2Fpoche","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etienne-napoleone%2Fpoche/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etienne-napoleone%2Fpoche/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etienne-napoleone%2Fpoche/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/etienne-napoleone","download_url":"https://codeload.github.com/etienne-napoleone/poche/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246459700,"owners_count":20780976,"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","fast","in-memory","library","python","simple"],"created_at":"2024-10-04T14:21:00.411Z","updated_at":"2025-03-31T11:24:51.087Z","avatar_url":"https://github.com/etienne-napoleone.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# poche\n\n[![Build Status](https://travis-ci.org/etienne-napoleone/poche.svg?branch=main)](https://travis-ci.org/etienne-napoleone/poche)\n[![Codecov](https://codecov.io/gh/etienne-napoleone/poche/branch/main/graph/badge.svg)](https://codecov.io/gh/etienne-napoleone/poche)\n[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nSimple and fast Python in-memory caching with support for TTLs.\n\nMeant to speed up using dictionaries as cache backend for simple usecases.\n\nNo external dependencies, 100% code coverage and static type checked.\n\n## Installation\n\nRequires Python 3.6+.\n\n```bash\npip install poche\n```\n\n## Roadmap\n\nv1:\n\n- [x] Basic TTL\n- [x] `get`\n- [x] `set`\n- [x] `getset`\n- [x] `flush`\n\nv1.1:\n\n- [ ] `expire`\n- [ ] `persist`\n- [ ] `rename`\n\nv1.2:\n\n- [ ] `getorset` with callback\n\n## Example\n\n```python\nfrom time import sleep\n\nimport poche\n\n\u003e\u003e\u003e c = poche.Cache()\n\n\u003e\u003e\u003e c.set(\"one\", \"uno\")\n\u003e\u003e\u003e c.get(\"one\")\n\"uno\"\n\n\u003e\u003e\u003e c.get(\"two\")\nNone\n\u003e\u003e\u003e c.getset(\"two\", \"dos\")\nNone\n\u003e\u003e\u003e c.get(\"two\")\n\"dos\"\n\n\u003e\u003e\u003e c.set(\"three\", \"tres\", ttl=2)\n\u003e\u003e\u003e c.get(\"three\")\n\"tres\"\n\u003e\u003e\u003e sleep(2)\n\u003e\u003e\u003e c.get(\"three\")\nNone\n\n\u003e\u003e\u003e c = poche.Cache(ttl=2)  # you can also define a default TTL\n\n\u003e\u003e\u003e c.set(\"four\", \"cuatro\")\n\u003e\u003e\u003e c.get(\"four\")\n\"cuatro\"\n\u003e\u003e\u003e sleep(2)\n\u003e\u003e\u003e c.get(\"four\")\nNone\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetienne-napoleone%2Fpoche","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fetienne-napoleone%2Fpoche","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetienne-napoleone%2Fpoche/lists"}