{"library":"redis-sentinel-url","title":"Redis Sentinel URL","description":"Redis-Sentinel-Url is a Python library that provides a parser and connection factory for Redis connections, specifically supporting both standard `redis://` and the custom `redis+sentinel://` URL schemes. It allows applications to connect to Redis instances via Sentinel for high availability. The library is currently at version 1.0.1, with its last major update addressing password handling, and it appears to be in maintenance mode, offering stable functionality rather than active feature development.","language":"python","status":"active","last_verified":"Sun May 17","install":{"commands":["pip install Redis-Sentinel-Url"],"cli":null},"imports":["from redis_sentinel_url import connect"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom redis_sentinel_url import connect\n\n# Example Sentinel URL. Replace with your actual Sentinel configuration.\n# The 'mymaster' is the service name configured in Redis Sentinel.\n# Use os.environ.get for sensitive info like passwords.\nREDIS_SENTINEL_URL = os.environ.get(\n    'REDIS_SENTINEL_URL',\n    'redis+sentinel://localhost:26379,otherhost:26479/mymaster/0?password=your_redis_master_password&sentinel_password=your_sentinel_password'\n)\n\ntry:\n    # Connect returns a (sentinel_client, redis_client) tuple\n    sentinel_client, redis_client = connect(REDIS_SENTINEL_URL)\n\n    if sentinel_client:\n        print(f\"Connected to Redis Sentinel service: {sentinel_client.service_name}\")\n        # You can get the current master and use it\n        master = sentinel_client.master_for(sentinel_client.service_name)\n        print(f\"Master host: {master.connection_pool.connection_kwargs.get('host')}\")\n        print(f\"Master port: {master.connection_pool.connection_kwargs.get('port')}\")\n        master.set('mykey', 'hello from sentinel')\n        print(f\"Set 'mykey': {master.get('mykey').decode('utf-8')}\")\n\n    if redis_client:\n        # If connecting directly to Redis without Sentinel, redis_client will be present and sentinel_client will be None\n        print(\"Connected directly to Redis.\")\n        redis_client.set('anotherkey', 'hello from direct redis')\n        print(f\"Set 'anotherkey': {redis_client.get('anotherkey').decode('utf-8')}\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n","lang":"python","description":"This quickstart demonstrates how to use `redis_sentinel_url.connect()` to establish connections. It attempts to connect using a `redis+sentinel://` URL, retrieving both the Sentinel client and a `StrictRedis` client for the master. It also illustrates setting and getting a key to confirm functionality. Ensure your `REDIS_SENTINEL_URL` environment variable is correctly configured with your Redis Sentinel setup.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-17","installed_version":"1.0.1","pypi_latest":"1.0.1","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":1.8,"avg_import_s":0.43,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"Redis-Sentinel-Url","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.33,"mem_mb":10.3,"disk_size":"21.6M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"Redis-Sentinel-Url","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.7,"import_time_s":0.24,"mem_mb":10.3,"disk_size":"22M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"Redis-Sentinel-Url","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.42,"mem_mb":11.9,"disk_size":"24.2M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"Redis-Sentinel-Url","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.9,"import_time_s":0.38,"mem_mb":11.9,"disk_size":"25M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"Redis-Sentinel-Url","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.63,"mem_mb":11.9,"disk_size":"15.9M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"Redis-Sentinel-Url","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.7,"import_time_s":0.58,"mem_mb":11.9,"disk_size":"16M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"Redis-Sentinel-Url","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.63,"mem_mb":12.1,"disk_size":"15.6M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"Redis-Sentinel-Url","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.8,"import_time_s":0.55,"mem_mb":12.1,"disk_size":"16M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"Redis-Sentinel-Url","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.26,"mem_mb":9.7,"disk_size":"20.5M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"Redis-Sentinel-Url","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.1,"import_time_s":0.24,"mem_mb":9.7,"disk_size":"21M"}]}}