Skip to main content

Flask-Multi-Redis

CI Status

Travis CI Status Codecov Coverage Status Coveralls Coverage Status Codacy Coverage Status Codacy Code Grade Landscape Code Health Code Climate Code Climate Coverage

PyPI Status

Pypi Version Pypi Status Python Implementation Python Versions License aGPLv3+

Adds Redis support to Flask with fail-over or aggregation capabilities.

Mostly inspired by these projects :

Built on top of redis-py.

Contributors

Description

Flask-Multi-Redis allows you to easily access multiple Redis servers from Flask applications. It supports SSL connections and password authentication. It’s not intended to implement all Redis commands but gives you the hability to make multi-threaded parallel queries to multiple Redis servers without the need to deploy a Redis cluster.

Installation

pip install flask-multi-redis

Configuration

Enable Flask-Multi-Redis in your application :

from flask import Flask
from flask.ext.redis import FlaskRedis

app = Flask(__name__)
redis_store = FlaskRedis(app)

Flask-Multi-Redis provide a simple flexible configuration handling. It reads its configuration from your Flask app.config dictionnary.

Default configuration for all servers :

app.config['REDIS_DEFAULT_PORT'] = 6379
app.config['REDIS_DEFAULT_DB'] = 0
app.config['REDIS_DEFAULT_PASSWORD'] = None
app.config['REDIS_DEFAULT_SOCKET_TIMEOUT'] = 5
app.config['REDIS_DEFAULT_SSL'] = None

Usage

FlaskMultiRedis proxies attribute access to an underlying Redis connection. So treat it as if it were a regular Redis instance.

@app.route('/')
def index():
    return redis_store.get('potato', 'Not Set')

Protip: The redis-py package currently holds the ‘redis’ namespace, so if you are looking to make use of it, your Redis object shouldn’t be named ‘redis’.

For detailed instructions regarding the usage of the client, check the redis-py documentation.

Advanced features, such as Lua scripting, pipelines and callbacks are detailed within the projects README.

Contribute

History

0.1.4 (2016-09-02)

  • Correct an error in aggregated put method

0.1.3 (2016-09-02)

  • Correct an error in aggregated delete method

0.1.2 (2016-09-02)

  • Correct an error in aggregated keys method

0.1.1 (2016-09-02)

  • Add scan_iter aggregated method

0.1.0 (2016-08-26)

  • First Beta : Now 100% covered

0.0.2 (2016-07-20)

  • First pre-release after some cleanup

0.0.1 (2016-07-20)

  • Initial commit

Metadata

Release files for Flask-Multi-Redis 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Flask-Multi-Redis 0.1.5
File Size Uploaded Provenance Actions
Flask-Multi-Redis-0.1.5.tar.gz 30.1 kB Without provenance Details for Flask-Multi-Redis-0.1.5.tar.gz

Release files / Flask-Multi-Redis-0.1.5.tar.gz

Download URL Flask-Multi-Redis-0.1.5.tar.gz
Size 30.1 kB
Tags Source
SHA-256 checksum
How to use checksums
326c72f24b4c7c2e41f1a15490fa5795da0a664e627fb7425e504d5d668632b0
BLAKE2b-256 checksum
How to use checksums
b0dd8dc7f5a9a91de81c46fd2aa9b3cedf3bcfca6a0a0795715d95d578f05cfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for Flask-Multi-Redis 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page