Skip to content

Latest commit

 

History

History
53 lines (40 loc) · 1.03 KB

README.md

File metadata and controls

53 lines (40 loc) · 1.03 KB

redis-url-py

This utility allows you to configure Redis in your Python applications using a url. This library was inspired by needing a way to seamlessly switch between redis-py and redis-py-cluster based on env configuration.

Usage

Non-Clustered Redis

redis_url_py.parse('redis://:[email protected]:6379/0')

{
    'host': '127.0.0.1',
    'port': 6379,
    'db': 0,
    'password': 'password'
}

Clustered Redis

redis_url_py.parse('redis://:[email protected]:6379?cluster=true')

{
    'host': '127.0.0.1',
    'port': 6379,
    'password': 'password',
}

Options

You may also specify options in your URL which can be used to configure a redis cluster.