{"id":19503647,"url":"https://github.com/im-cloud-spain-connectors/python-cache-postgresql-adapter","last_synced_at":"2025-07-10T07:04:08.890Z","repository":{"id":65874451,"uuid":"601559325","full_name":"IM-Cloud-Spain-Connectors/python-cache-postgresql-adapter","owner":"IM-Cloud-Spain-Connectors","description":"PostgreSQL implementation of the Cache Interface for Python.","archived":false,"fork":false,"pushed_at":"2023-06-27T11:00:25.000Z","size":23,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T17:47:10.220Z","etag":null,"topics":["adapter","cache","component","postgresql","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IM-Cloud-Spain-Connectors.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":"2023-02-14T10:25:25.000Z","updated_at":"2023-06-23T08:07:45.000Z","dependencies_parsed_at":"2024-11-10T22:22:48.849Z","dependency_job_id":"917ce082-2d93-48fa-8622-62260c9709ef","html_url":"https://github.com/IM-Cloud-Spain-Connectors/python-cache-postgresql-adapter","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/IM-Cloud-Spain-Connectors/python-cache-postgresql-adapter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IM-Cloud-Spain-Connectors%2Fpython-cache-postgresql-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IM-Cloud-Spain-Connectors%2Fpython-cache-postgresql-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IM-Cloud-Spain-Connectors%2Fpython-cache-postgresql-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IM-Cloud-Spain-Connectors%2Fpython-cache-postgresql-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IM-Cloud-Spain-Connectors","download_url":"https://codeload.github.com/IM-Cloud-Spain-Connectors/python-cache-postgresql-adapter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IM-Cloud-Spain-Connectors%2Fpython-cache-postgresql-adapter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264545017,"owners_count":23625387,"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":["adapter","cache","component","postgresql","python"],"created_at":"2024-11-10T22:22:28.595Z","updated_at":"2025-07-10T07:04:08.862Z","avatar_url":"https://github.com/IM-Cloud-Spain-Connectors.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Cache PostgreSQL Adapter\n\n[![Test and Analysis](https://github.com/othercodes/python-cache-postgresql-adapter/actions/workflows/test.yml/badge.svg)](https://github.com/othercodes/python-cache-postgresql-adapter/actions/workflows/test.yml)\n\nProvides a PostgreSQL implementation of the Cache Interface for Python.\n\n## Installation\n\nThe easiest way to install the Cache PostgreSQL Adapter is to get the latest version from PyPI:\n\n```bash\n# using poetry\npoetry add rndi-cache-postgresql-adapter\n# using pip\npip install rndi-cache-postgresql-adapter\n```\n\n## The Contract\n\nThe used interface is `rndi.cache.contracts.Cache`.\n\n## The Adapter\n\nJust initialize the class you want and use the public methods:\n\n```python\nfrom rndi.cache.contracts import Cache\nfrom rndi.cache.adapters.postgresql.adapter import PostgreSQLCacheAdapter\n\n\ndef some_process_that_requires_cache(cache: Cache):\n    # retrieve the data from cache, ir the key is not cached yet and the default \n    # value is a callable the cache will use it to compute and cache the value\n    user = cache.get('user-id', lambda: db_get_user('user-id'))\n\n    print(user)\n\n\n# inject the desired cache adapter.\ncache = PostgreSQLCacheAdapter(\n    'localhost',\n    'database_name',\n    'username', \n    'password', \n    ttl=900, # optional\n    port=5432 # optional\n)\nsome_process_that_requires_cache(cache)\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fim-cloud-spain-connectors%2Fpython-cache-postgresql-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fim-cloud-spain-connectors%2Fpython-cache-postgresql-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fim-cloud-spain-connectors%2Fpython-cache-postgresql-adapter/lists"}