Redis-Sentinel-Url
==================
.. image:: https://travis-ci.org/exponea/redis-sentinel-url.svg
:target: https://travis-ci.org/exponea/redis-sentinel-url
:alt: Travis CI
Redis-Sentinel-Url provides parser and connection factory for `redis://` and `redis+sentinel://` URLs (the latter
being defined by this package).
* Supports Python 2.7 and 3.3+
* Licensed using Apache License 2.0
Installation
------------
Install with pip::
pip install Redis-Sentinel-Url
URL scheme for connecting via Sentinel
--------------------------------------
This package defines `redis+sentinel://` scheme for connecting to Redis via Sentinel::
redis+sentinel://[:password@]host:port[,host2:port2,...][/service_name[/db]][?param1=value1[¶m2=value=2&...]]
- You can specify multiple sentinel host:port pairs separated by comma.
- If `service_name` is provided, it is used to create a default client
- `service_name` and `db` can also be specified as URL parameters (URL parameters take precedence)
- Client options (keyword arguments to `redis.StrictRedis`) are specified as URL parameters
- Options for connecting to Sentinel (keyword arguments to `redis.sentinel.Sentinel`) are specified
with `sentinel_` prefix
- There is special `client_type` option to specify whether the default client should be `master` (the default) or
`slave` service when connecting via Sentinel
Basic usage
-----------
Supports schemes supported by `redis.StrictRedis.from_url` and also `redis+sentinel://` scheme described above:
.. code-block:: python
import redis_sentinel_url
sentinel, client = redis_sentinel_url.connect('redis://localhost/0')
# None, StrictRedis(...)
sentinel, client = redis_sentinel_url.connect('rediss://localhost/0')
# None, StrictRedis(...)
sentinel, client = redis_sentinel_url.connect('unix://[:password]@/path/to/socket.sock?db=0')
# None, StrictRedis(...)
sentinel, client = redis_sentinel_url.connect('redis+sentinel://localhost:26379,otherhost:26479/mymaster/0')
# Sentinel(...), StrictRedis(...)
Raw data
{
"_id": null,
"home_page": "https://github.com/exponea/redis-sentinel-url",
"name": "Redis-Sentinel-Url",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Martin Sucha",
"author_email": "martin.sucha@exponea.com",
"download_url": "https://files.pythonhosted.org/packages/cc/e3/68de4c8aacbd9952667d7d0f5af55b873553a09a6227ac5b7f7c622610c9/Redis-Sentinel-Url-1.0.1.tar.gz",
"platform": "UNKNOWN",
"description": "Redis-Sentinel-Url\n==================\n\n.. image:: https://travis-ci.org/exponea/redis-sentinel-url.svg\n :target: https://travis-ci.org/exponea/redis-sentinel-url\n :alt: Travis CI\n\nRedis-Sentinel-Url provides parser and connection factory for `redis://` and `redis+sentinel://` URLs (the latter\nbeing defined by this package).\n\n* Supports Python 2.7 and 3.3+\n* Licensed using Apache License 2.0\n\nInstallation\n------------\n\nInstall with pip::\n\n pip install Redis-Sentinel-Url\n\n\nURL scheme for connecting via Sentinel\n--------------------------------------\n\nThis package defines `redis+sentinel://` scheme for connecting to Redis via Sentinel::\n\n redis+sentinel://[:password@]host:port[,host2:port2,...][/service_name[/db]][?param1=value1[¶m2=value=2&...]]\n\n- You can specify multiple sentinel host:port pairs separated by comma.\n- If `service_name` is provided, it is used to create a default client\n- `service_name` and `db` can also be specified as URL parameters (URL parameters take precedence)\n- Client options (keyword arguments to `redis.StrictRedis`) are specified as URL parameters\n- Options for connecting to Sentinel (keyword arguments to `redis.sentinel.Sentinel`) are specified\n with `sentinel_` prefix\n- There is special `client_type` option to specify whether the default client should be `master` (the default) or\n `slave` service when connecting via Sentinel\n\nBasic usage\n-----------\n\nSupports schemes supported by `redis.StrictRedis.from_url` and also `redis+sentinel://` scheme described above:\n\n.. code-block:: python\n\n import redis_sentinel_url\n\n sentinel, client = redis_sentinel_url.connect('redis://localhost/0')\n # None, StrictRedis(...)\n\n sentinel, client = redis_sentinel_url.connect('rediss://localhost/0')\n # None, StrictRedis(...)\n\n sentinel, client = redis_sentinel_url.connect('unix://[:password]@/path/to/socket.sock?db=0')\n # None, StrictRedis(...)\n\n sentinel, client = redis_sentinel_url.connect('redis+sentinel://localhost:26379,otherhost:26479/mymaster/0')\n # Sentinel(...), StrictRedis(...)\n",
"bugtrack_url": null,
"license": "Apache 2.0",
"summary": "A factory for redis connection that supports using Redis Sentinel",
"version": "1.0.1",
"project_urls": {
"Homepage": "https://github.com/exponea/redis-sentinel-url"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "403520f997f367c87ef1e6ebf418af7c2450cb5da860d066d7229226031534ad",
"md5": "48364094a2601654fe54bd250d88b042",
"sha256": "c6991e2000c5c7a5e2b95eb2d62fd5b0a6b02a59554caf0f9f79d18e152d9663"
},
"downloads": -1,
"filename": "Redis_Sentinel_Url-1.0.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "48364094a2601654fe54bd250d88b042",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 4685,
"upload_time": "2017-04-05T07:47:53",
"upload_time_iso_8601": "2017-04-05T07:47:53.545693Z",
"url": "https://files.pythonhosted.org/packages/40/35/20f997f367c87ef1e6ebf418af7c2450cb5da860d066d7229226031534ad/Redis_Sentinel_Url-1.0.1-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cce368de4c8aacbd9952667d7d0f5af55b873553a09a6227ac5b7f7c622610c9",
"md5": "8cbaed61b13b1b01d79b31881473eac3",
"sha256": "ec1854ab9379a28789423c3cd4082739fb69c7b4b11bb50ae7858697c131b13e"
},
"downloads": -1,
"filename": "Redis-Sentinel-Url-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "8cbaed61b13b1b01d79b31881473eac3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7599,
"upload_time": "2017-04-05T07:47:55",
"upload_time_iso_8601": "2017-04-05T07:47:55.456116Z",
"url": "https://files.pythonhosted.org/packages/cc/e3/68de4c8aacbd9952667d7d0f5af55b873553a09a6227ac5b7f7c622610c9/Redis-Sentinel-Url-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2017-04-05 07:47:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "exponea",
"github_project": "redis-sentinel-url",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"tox": true,
"lcname": "redis-sentinel-url"
}