{ "info": { "author": "Bence Nagy", "author_email": "bence@underyx.me", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Flask", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# flask-redis\n\n[![CircleCI](https://circleci.com/gh/underyx/flask-redis.svg?style=svg)](https://circleci.com/gh/underyx/flask-redis)\n[![codecov](https://codecov.io/gh/underyx/flask-redis/branch/master/graph/badge.svg)](https://codecov.io/gh/underyx/flask-redis)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/8f8297c1a5f542d49429c4837165984f)](https://www.codacy.com/app/bence/flask-redis?utm_source=github.com&utm_medium=referral&utm_content=underyx/flask-redis&utm_campaign=Badge_Grade)\n[![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/underyx/flask-redis.svg)](https://github.com/underyx/flask-redis/tags)\n\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/flask-redis.svg)\n![Flask version support is 0.9+](https://img.shields.io/badge/flask-0.9%2B-blue.svg)\n![redis-py version support is 2.6+](https://img.shields.io/badge/redis--py-2.6%2B-blue.svg)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-black.svg)](https://github.com/ambv/black)\n\nA nice way to use Redis in your Flask app.\n\n## Configuration\n\nStart by installing the extension with `pip install flask-redis`.\nOnce that's done, configure it within your Flask config.\nSet the URL of your Redis instance like this:\n\n```python\nREDIS_URL = \"redis://:password@localhost:6379/0\"\n```\n\nIf you wanna connect to a Unix socket,\nyou can specify it like `\"unix://:password@/path/to/socket.sock?db=0\"`.\n\n## Usage\n\n### Setup\n\nTo add a Redis client to your application:\n\n```python\nfrom flask import Flask\nfrom flask_redis import FlaskRedis\n\napp = Flask(__name__)\nredis_client = FlaskRedis(app)\n```\n\nor if you prefer, you can do it the other way around:\n\n```python\nredis_client = FlaskRedis(app)\ndef create_app():\n app = Flask(__name__)\n redis_client.init_app(app)\n return app\n```\n\n### Accessing Redis\n\nThe redis client you created above from `FlaskRedis` acts just like a regular `Redis` instance from the [`redis-py`](https://github.com/andymccurdy/redis-py) library:\n\n```python\nfrom my_app import redis_client\n\n@app.route('/')\ndef index():\n return redis_client.get('potato')\n```\n\nFor detailed instructions on what methods you can use on the client,\nas well as how you can use advanced features\nsuch as Lua scripting, pipelines, and callbacks,\nplease check the\n[redis-py documentation](https://redis-py.readthedocs.io/en/latest/).\n\n**Pro-tip:** The [redis-py](https://github.com/andymccurdy/redis-py)\npackage uses the `redis` namespace, so it's nicer to name your Redis object something like `redis_client` instead of just `redis`.\n\n## Extra features in flask-redis\n\n### Custom providers\n\nInstead of the default `Redis` client from `redis-py`,\nyou can provide your own.\nThis can be useful to replace it with [mockredis](https://github.com/locationlabs/mockredis) for testing:\n\n```python\nfrom flask import Flask\nfrom flask_redis import FlaskRedis\nfrom mockredis import MockRedis\n\n\ndef create_app():\n app = Flask(__name__)\n if app.testing:\n redis_store = FlaskRedis.from_custom_provider(MockRedis)\n else:\n redis_store = FlaskRedis()\n redis_store.init_app(app)\n return app\n```\n\n## Contributing\n\n1. Check for open issues or open a fresh issue to start a discussion\n2. Fork [the repository](https://github.com/underyx/flask-redis) on GitHub.\n3. Send a pull request with your code!\n\nMerging will require a test which shows that the bug was fixed,\nor that the feature works as expected.\nFeel free to open a draft pull request though without such a test\nand ask for help with writing it if you're not sure how to.\n\nAs [Bence](https://underyx.me) (the only maintainer) works full-time,\nplease allow some time before your issue or pull request is handled.\n\n\n## Changelog\n\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)\nand this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).\n\n## 0.4.0 (2019-05-29)\n\n- Reorganized the module and rewrote everything other than the library code, mainly packaging and CI. There are no user-facing changes in behavior.\n\n## 0.3.0 (2016-07-18)\n\n- **Backwards incompatible:** The `FlaskRedis.init_app` method no\n longer takes a `strict` parameter. Pass this flag when creating your\n `FlaskRedis` instance, instead.\n- **Backwards incompatible:** The extension will now be registered\n under the (lowercased) config prefix of the instance. The default\n config prefix is `'REDIS'`, so unless you change that, you can still\n access the extension via `app.extensions['redis']` as before.\n- **Backwards incompatible:** The default class has been changed to\n `redis.StrictRedis`. You can switch back to the old `redis.Redis`\n class by specifying `strict=False` in the `FlaskRedis` kwargs.\n- You can now pass all supported `Redis` keyword arguments (such as\n `decode_responses`) to `FlaskRedis` and they will be correctly\n passed over to the `redis-py` instance. Thanks, @giyyapan\\!\n- Usage like `redis_store['key'] = value`, `redis_store['key']`, and\n `del redis_store['key']` is now supported. Thanks, @ariscn\\!\n\n## 0.2.0 (2015-04-15)\n\n- Made 0.1.0's deprecation warned changes final\n\n## 0.1.0 (2015-04-15)\n\n- **Deprecation:** Renamed `flask_redis.Redis` to\n `flask_redis.FlaskRedis`. Using the old name still works, but emits\n a deprecation warning, as it will be removed from the next version\n- **Deprecation:** Setting a `REDIS_DATABASE` (or equivalent) now\n emits a deprecation warning as it will be removed in the version in\n favor of including the database number in `REDIS_URL` (or\n equivalent)\n- Added a `FlaskRedis.from_custom_provider(provider)` class method for\n using any redis provider class that supports instantiation with a\n `from_url` class method\n- Added a `strict` parameter to `FlaskRedis` which expects a boolean\n value and allows choosing between using `redis.StrictRedis` and\n `redis.Redis` as the defualt provider.\n- Made `FlaskRedis` register as a Flask extension through Flask's\n extension API\n- Rewrote test suite in py.test\n- Got rid of the hacky attribute copying mechanism in favor of using\n the `__getattr__` magic method to pass calls to the underlying\n client\n\n## 0.0.6 (2014-04-09)\n\n- Improved Python 3 Support (Thanks underyx\\!).\n- Improved test cases.\n- Improved configuration.\n- Fixed up documentation.\n- Removed un-used imports (Thanks underyx and lyschoening\\!).\n\n## 0.0.5 (2014-02-17)\n\n- Improved suppot for the config prefix.\n\n## 0.0.4 (2014-02-17)\n\n- Added support for config_prefix, allowing multiple DBs.\n\n## 0.0.3 (2013-07-06)\n\n- Added TravisCI Testing for Flask 0.9/0.10.\n- Added Badges to README.\n\n## 0.0.2 (2013-07-06)\n\n- Implemented a very simple test.\n- Fixed some documentation issues.\n- Included requirements.txt for testing.\n- Included task file including some basic methods for tests.\n\n## 0.0.1 (2013-07-05)\n\n- Conception\n- Initial Commit of Package to GitHub.\n\n\n## Credits\n\nThe `flask-redis` project is written and maintained\nby [Bence Nagy (underyx)](https://underyx.me).\n\nThe project was originally created by [Rhys Elsmore](https://rhys.io/),\nwho maintained it until the 0.0.6 release in 2014.\nHis work was licensed under the Apache 2 license.\nThe project has gone through a full rewrite since,\nbut his work was essential as inspiration.\nThanks, Rhys!\n\nA full list of contributors can be found on [GitHub's Contributors page](https://github.com/underyx/flask-redis/graphs/contributors)\nor you can obtain it on your own by running `git shortlog -sn`.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/underyx/flask-redis/releases", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/underyx/flask-redis/", "keywords": "flask,redis", "license": "", "maintainer": "Bence Nagy", "maintainer_email": "bence@underyx.me", "name": "flask-redis", "package_url": "https://pypi.org/project/flask-redis/", "platform": "", "project_url": "https://pypi.org/project/flask-redis/", "project_urls": { "Download": "https://github.com/underyx/flask-redis/releases", "Homepage": "https://github.com/underyx/flask-redis/" }, "release_url": "https://pypi.org/project/flask-redis/0.4.0/", "requires_dist": [ "Flask (>=0.8)", "redis (>=2.7.6)", "coverage ; extra == 'dev'", "pytest ; extra == 'dev'", "pytest-mock ; extra == 'dev'", "pre-commit ; extra == 'dev'", "coverage ; extra == 'tests'", "pytest ; extra == 'tests'", "pytest-mock ; extra == 'tests'" ], "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "summary": "A nice way to use Redis in your Flask app", "version": "0.4.0" }, "last_serial": 5331754, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "8b1ea6d308ce753aa4bb284b5d284927", "sha256": "7367bd83ce3f143d5fc39b7d027462c8e72358d44825132391d470bda8062bd8" }, "downloads": -1, "filename": "Flask-Redis-0.0.1.tar.gz", "has_sig": false, "md5_digest": "8b1ea6d308ce753aa4bb284b5d284927", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3884, "upload_time": "2013-07-05T12:47:03", "url": "https://files.pythonhosted.org/packages/0f/b7/c405a6b585a7d47b7a9d917d4a77f7d553542e4133025b2b3fe7a69b586d/Flask-Redis-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "4369aac18ca4825eada7f6d6e924ea4d", "sha256": "7ed56d3ccdb7ddfdcd0f322cf69e7978fd3625078cc304b3642522c081572cb8" }, "downloads": -1, "filename": "Flask-Redis-0.0.2.tar.gz", "has_sig": false, "md5_digest": "4369aac18ca4825eada7f6d6e924ea4d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4186, "upload_time": "2013-07-06T00:41:42", "url": "https://files.pythonhosted.org/packages/ef/4d/dfe588de1da9602355c0658eca9e63eb0085f476b4c0940835d7424dc50a/Flask-Redis-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "5616bb10d7cbcc38d5dc69a615f0ca8d", "sha256": "aa7d7d0d64cd0b4d80723aca84089c8c917d1ffab390cc9f8405ae9d48c0d4bf" }, "downloads": -1, "filename": "Flask-Redis-0.0.3.tar.gz", "has_sig": false, "md5_digest": "5616bb10d7cbcc38d5dc69a615f0ca8d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4332, "upload_time": "2013-07-06T01:36:20", "url": "https://files.pythonhosted.org/packages/17/66/4fbccb7a59a095cf3943edcc20079fa5faee45a59e2b68283049b7b2d2b7/Flask-Redis-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "7f9f14695b3217a1f74931bea10a5cb0", "sha256": "2a25bb7e34c6b37b4a66d75a45927cbe6b42100c8121b687190793b3b85caf26" }, "downloads": -1, "filename": "Flask-Redis-0.0.4.tar.gz", "has_sig": false, "md5_digest": "7f9f14695b3217a1f74931bea10a5cb0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4753, "upload_time": "2014-02-17T22:16:57", "url": "https://files.pythonhosted.org/packages/a6/6f/8b4b12811045e8419db9a7c3814cf4533f89dd771f9bf9d923289252fde7/Flask-Redis-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "5754fc13346629ec0e2d3a248879aaec", "sha256": "39bc6b8461f4964b6fd2830dddf837dd08dde4c274d8b1f844e66a8124b176ac" }, "downloads": -1, "filename": "Flask-Redis-0.0.5.tar.gz", "has_sig": false, "md5_digest": "5754fc13346629ec0e2d3a248879aaec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4240, "upload_time": "2014-02-17T23:11:42", "url": "https://files.pythonhosted.org/packages/72/61/975e0532c9b97f1889f2ed19b6c46cd6414f9adc6641a1591742a76a46ed/Flask-Redis-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "9ebcc09207923a4553b7a8690b819734", "sha256": "f0d49837581bfb9985f9af73620d3eebec5ca24d7cfe3578a3ae33e698a56488" }, "downloads": -1, "filename": "Flask-Redis-0.0.6.tar.gz", "has_sig": false, "md5_digest": "9ebcc09207923a4553b7a8690b819734", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4093, "upload_time": "2014-09-04T11:02:09", "url": "https://files.pythonhosted.org/packages/b6/06/e41eb372e7039dc01801a83750879aa2d2e964f5859fa71cc8a38267b0b1/Flask-Redis-0.0.6.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "9bb061a5bd146d424d5b0e2c94f7bd54", "sha256": "db05c0d7912d529ac416f082ac3257eedab12d38ccb4a5c2210b346174a4358b" }, "downloads": -1, "filename": "Flask_Redis-0.1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "9bb061a5bd146d424d5b0e2c94f7bd54", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 8667, "upload_time": "2015-04-14T23:36:15", "url": "https://files.pythonhosted.org/packages/59/1c/f79b76ff67ae5bbd4e29b834dd6745c9524585253dd8e26308950896011f/Flask_Redis-0.1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4afbd64fa7cf19945ebd616139eb6163", "sha256": "d930f96cc0fd1f6e839821485752eb641a850eb51005307222709b57fd35405e" }, "downloads": -1, "filename": "Flask_Redis-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "4afbd64fa7cf19945ebd616139eb6163", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 8666, "upload_time": "2015-04-14T23:36:31", "url": "https://files.pythonhosted.org/packages/14/0c/a8f82cb7542fa0109c86387254e8bbd12006648a8f0f2a633873ee4b9e2d/Flask_Redis-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1484f2f7f78ab858f29312129d164630", "sha256": "3db36ba04a50d7bd0180389e6f5fd02b34cc1c7ff2ecfd03ead421bdcdf9b815" }, "downloads": -1, "filename": "Flask-Redis-0.1.0.zip", "has_sig": true, "md5_digest": "1484f2f7f78ab858f29312129d164630", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12774, "upload_time": "2015-11-15T10:52:26", "url": "https://files.pythonhosted.org/packages/4e/77/00cd607718d01f2f5eb6545512c7e3b50c6b17b547729dc1c14faa187ed5/Flask-Redis-0.1.0.zip" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "e3b2478437662e515a0e10246a486b1b", "sha256": "ffb8e636c7af0226a3074860200602850a5a871169bc53fcde05b7d973aad714" }, "downloads": -1, "filename": "Flask_Redis-0.3.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "e3b2478437662e515a0e10246a486b1b", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 8761, "upload_time": "2016-07-18T16:30:01", "url": "https://files.pythonhosted.org/packages/8b/59/e29f607475ca6ae21e30ff5e6ca0f2fd58701879a31ffeff7471ea3865f6/Flask_Redis-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4a9eced017cf4d72983f61abb426d6b7", "sha256": "56ebd5e69a42988e9a7a904f07b37cd625a7dbcdfbfe31797885c3c4a92516f5" }, "downloads": -1, "filename": "Flask-Redis-0.3.0.tar.gz", "has_sig": true, "md5_digest": "4a9eced017cf4d72983f61abb426d6b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5935, "upload_time": "2016-08-26T19:24:25", "url": "https://files.pythonhosted.org/packages/d2/79/1243f0b70f6545bbd649a2bd75bd32bfe45979ac0cbfde89e69fdf1b381b/Flask-Redis-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "76de72bbf395704b2d4395c0e9d36737", "sha256": "8d79eef4eb1217095edab603acc52f935b983ae4b7655ee7c82c0dfd87315d17" }, "downloads": -1, "filename": "flask_redis-0.4.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "76de72bbf395704b2d4395c0e9d36737", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 8550, "upload_time": "2019-05-29T10:55:52", "url": "https://files.pythonhosted.org/packages/9d/9c/cead8fff1c8da2bd31a83ec476c3364812ee74f3c7c3445d070555f681d1/flask_redis-0.4.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "41a3f42ee360f53f9b78030af7683dfd", "sha256": "e1fccc11e7ea35c2a4d68c0b9aa58226a098e45e834d615c7b6c4928b01ddd6c" }, "downloads": -1, "filename": "flask-redis-0.4.0.tar.gz", "has_sig": true, "md5_digest": "41a3f42ee360f53f9b78030af7683dfd", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 9906, "upload_time": "2019-05-29T10:55:54", "url": "https://files.pythonhosted.org/packages/b8/d1/6e5a087e2fd99782451312dd467bbf5f9f64d999de900047dc0854a7d175/flask-redis-0.4.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "76de72bbf395704b2d4395c0e9d36737", "sha256": "8d79eef4eb1217095edab603acc52f935b983ae4b7655ee7c82c0dfd87315d17" }, "downloads": -1, "filename": "flask_redis-0.4.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "76de72bbf395704b2d4395c0e9d36737", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 8550, "upload_time": "2019-05-29T10:55:52", "url": "https://files.pythonhosted.org/packages/9d/9c/cead8fff1c8da2bd31a83ec476c3364812ee74f3c7c3445d070555f681d1/flask_redis-0.4.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "41a3f42ee360f53f9b78030af7683dfd", "sha256": "e1fccc11e7ea35c2a4d68c0b9aa58226a098e45e834d615c7b6c4928b01ddd6c" }, "downloads": -1, "filename": "flask-redis-0.4.0.tar.gz", "has_sig": true, "md5_digest": "41a3f42ee360f53f9b78030af7683dfd", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 9906, "upload_time": "2019-05-29T10:55:54", "url": "https://files.pythonhosted.org/packages/b8/d1/6e5a087e2fd99782451312dd467bbf5f9f64d999de900047dc0854a7d175/flask-redis-0.4.0.tar.gz" } ] }