{"id":15783647,"url":"https://github.com/deepmancer/aredis-client","last_synced_at":"2025-04-01T14:32:08.134Z","repository":{"id":249647080,"uuid":"832098140","full_name":"deepmancer/aredis-client","owner":"deepmancer","description":"Async Redis Client is a simple and easy-to-use module to interact with Redis databases","archived":false,"fork":false,"pushed_at":"2024-08-16T11:31:41.000Z","size":36,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-11T20:02:53.570Z","etag":null,"topics":["aioredis","async-redis","asyncio","python","redis","redis-client","redis-database","redis-py","redis-sentinel","redis-server"],"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/deepmancer.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":"2024-07-22T10:53:24.000Z","updated_at":"2024-08-28T09:08:46.000Z","dependencies_parsed_at":"2024-07-22T13:24:28.128Z","dependency_job_id":"546927bd-bbb0-47df-ab7d-60403a032bca","html_url":"https://github.com/deepmancer/aredis-client","commit_stats":null,"previous_names":["alirezaheidari-cs/aredis-client","deepmancer/aredis-client"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepmancer%2Faredis-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepmancer%2Faredis-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepmancer%2Faredis-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepmancer%2Faredis-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepmancer","download_url":"https://codeload.github.com/deepmancer/aredis-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246604612,"owners_count":20804100,"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":["aioredis","async-redis","asyncio","python","redis","redis-client","redis-database","redis-py","redis-sentinel","redis-server"],"created_at":"2024-10-04T20:00:25.088Z","updated_at":"2025-04-01T14:32:08.124Z","avatar_url":"https://github.com/deepmancer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧰 Async Redis Client\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Redis-FF4438.svg?style=for-the-badge\u0026logo=Redis\u0026logoColor=white\" alt=\"Redis\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/PyPI-3775A9.svg?style=for-the-badge\u0026logo=PyPI\u0026logoColor=white\" alt=\"PyPI\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/python-3670A0?style=for-the-badge\u0026logo=python\u0026logoColor=ffdd54\" alt=\"Python\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=for-the-badge\" alt=\"License\"\u003e\n\u003c/p\u003e\n\n**`aredis-client`** is your go-to Python package for seamless asynchronous Redis interactions, powered by `redis-py`. With its singleton-based connection pooling, it ensures efficient, thread-safe operations, making your Redis experience faster and easier.\n\n---\n\n| **Source Code** | **Website** |\n|:-----------------|:------------|\n| \u003ca href=\"https://github.com/deepmancer/aredis-client\" target=\"_blank\"\u003egithub.com/deepmancer/aredis-client\u003c/a\u003e | \u003ca href=\"https://deepmancer.github.io/aredis-client/\" target=\"_blank\"\u003edeepmancer.github.io/aredis-client\u003c/a\u003e |\n\n---\n\n## ✨ Features\n\n- 💼 **Full Compatibility**: Works effortlessly with the `redis-py` library.\n- ⚡ **Asynchronous Operations**: Async Redis connections for improved performance.\n- 🛠️ **Singleton Pattern**: Efficiently manage Redis connections using a singleton design.\n- 🔄 **Context Manager Support**: Easily manage Redis sessions.\n- 🔧 **Simple Configuration**: Configure effortlessly with `RedisConfig`.\n\n## 📦 Installation\n\nGet started quickly by installing `aredis-client` with pip:\n\n```sh\npip install git+https://github.com/deepmancer/aredis-client.git\n```\n\n## 📝 Usage Guide\n\n### 🔧 Configuration\n\nStart by creating a configuration object with `RedisConfig`:\n\n```python\nfrom aredis_client import RedisConfig\n\nconfig = RedisConfig(\n    host='localhost',\n    port=6379,\n    db=0,\n)\n```\n\n### 🏗️ Creating an AsyncRedis Instance\n\nNext, create an instance of `AsyncRedis` using the configuration:\n\n```python\nfrom aredis_client import AsyncRedis\n\nasync def main():\n    redis_client = await AsyncRedis.create(config=config)\n    print(redis_client.url)\n```\n\n### ⚙️ Managing Redis Sessions\n\nInteract with the Redis server using the context manager from `get_or_create_session`:\n\n```python\nfrom aredis_client import AsyncRedis\n\nasync def main():\n    redis_client = await AsyncRedis.create(config=config)\n\n    async with redis_client.get_or_create_session() as session:\n        # Interact with your Redis server\n        await session.set('key', 'value')\n        value = await session.get('key')\n        print(value)\n\n    await redis_client.disconnect()\n```\n\n### 🔍 Example Usage\n\nHere's a complete example to demonstrate the power of `aredis-client`:\n\n```python\nimport asyncio\nfrom aredis_client import AsyncRedis, RedisConfig\n\nasync def main():\n    config = RedisConfig(\n        host='localhost',\n        port=6379,\n        db=0,\n    )\n    client = await AsyncRedis.create(config=config)\n\n    async with client.get_or_create_session() as session:\n        await session.set('key', 'value')\n        value = await session.get('key')\n        print(f'The value for \"key\" is {value}')\n        \n        keys = ['key1', 'key2', 'key3']\n        pipeline = session.pipeline()\n        for key in keys:\n            pipeline.delete(key)\n        await pipeline.execute()\n        \n    await client.disconnect()\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n### 🛡️ Error Handling\n\nStay safe with custom exceptions to handle Redis-related errors:\n\n- `RedisConnectionError`\n- `RedisSessionCreationError`\n\n### 🛑 Disconnecting\n\nEnsure a clean disconnect from the Redis server:\n\n```python\nawait redis_client.disconnect()\n```\n\n## 📄 License\n\nThis project is licensed under the Apache License 2.0. See the [LICENSE](https://github.com/deepmancer/aredis-client/blob/main/LICENSE) file for full details.\n\n---\n\n**Get started with `aredis-client` today and take your Redis operations much easier!** 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepmancer%2Faredis-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepmancer%2Faredis-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepmancer%2Faredis-client/lists"}