Redis Tools for FastPluggy
A powerful Redis browser and management plugin for FastPluggy applications. This plugin provides a user-friendly interface to browse, search, and manage Redis databases and keys.
Features
- Redis Browser UI: Intuitive web interface to browse and manage Redis data
- Multi-Database Support: Switch between Redis databases easily
- Key Management: View, search, and delete Redis keys
- Data Type Support: Full support for all Redis data types (string, list, hash, set, zset)
- Pickled Data Handling: Automatic detection and unpickling of Python pickled data
- TTL Management: View time-to-live for keys
- Database Flushing: Clear entire databases with confirmation
- Scheduled Cleanup: Optional scheduled task to clean expired keys (requires tasks_worker plugin)
Installation
- Install the official plugin package:
pip install fastpluggy-plugins
or
pip install fastpluggy-plugin-redis
- Add the plugin to your FastPluggy application:
There are several ways to add the plugin to your FastPluggy application:
Method 1: Using the Admin Interface
- Navigate to
/admin/pluginsin your FastPluggy application - Click on "Install New Plugin"
- Enter "redis_tools" as the plugin name
- Click "Install"
Method 2: Using the Configuration File
Add the plugin to your FastPluggy configuration file:
# config.py
FASTPLUGGY_PLUGINS = [
# other plugins...
"redis_tools",
]
Method 3: Programmatically
Add the plugin programmatically in your application code:
from fastapi import FastAPI
from fastpluggy import FastPluggy
app = FastAPI()
pluggy = FastPluggy(app)
# Add the Redis Tools plugin
pluggy.add_plugin("redis_tools")
For more detailed installation and configuration instructions, see the Installation Guide.
Configuration
Configure Redis Tools through environment variables or directly in your FastPluggy configuration:
| Setting | Description | Default |
|---|---|---|
REDIS_DSN |
Redis connection string (overrides other connection settings if provided) | None |
redis_host |
Redis server hostname | localhost |
redis_port |
Redis server port | 6379 |
redis_db |
Default Redis database index | 0 |
use_ssl |
Whether to use SSL for Redis connection | False |
redis_password |
Redis server password | None |
redis_decode_responses |
Whether to decode Redis responses | False |
keys_limit |
Maximum number of keys to display | 100 |
Usage
Web Interface
Once installed, access the Redis browser at /redis_tools/ in your FastPluggy application. The interface allows you to:
- Select and switch between Redis databases
- Search for keys using patterns (e.g.,
user:*) - View key details including type, TTL, and size
- Examine and format key values based on their data type
- Delete individual keys
- Flush entire databases
Programmatic Usage
You can also use the Redis Tools connector in your code:
from redis_tools.redis_connector import RedisConnection
# Create a connection
redis_conn = RedisConnection()
# Test connection
if redis_conn.test_connection():
# Get all keys matching a pattern
keys = redis_conn.get_keys("user:*")
# Get details for a specific key
key_details = redis_conn.get_key_details("user:1001")
# Switch to another database
redis_conn.select_db(2)
# Delete a key
redis_conn.delete_key("temporary_key")
Development
Requirements
- Python 3.10+
- FastPluggy
- Redis
Testing
Run tests with pytest:
cd redis_tools
pip install -r tests/requirements.txt
pytest
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for fastpluggy-redis 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fastpluggy_redis-0.1.7.tar.gz | 19.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fastpluggy_redis-0.1.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 42.1 kB
Release files / fastpluggy_redis-0.1.7.tar.gz
| Download URL | fastpluggy_redis-0.1.7.tar.gz |
|---|---|
| Size | 19.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d6aef0dbca940f25d8357523da531676009ce5a74b2e2dc1dfb6097459ad64af
|
|
BLAKE2b-256 checksum How to use checksums |
035c8c8c562f4d4b2f18f60da7a5c3c456a8c31c8d293864f061c65640190b18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Release files / fastpluggy_redis-0.1.7-py3-none-any.whl
| Download URL | fastpluggy_redis-0.1.7-py3-none-any.whl |
|---|---|
| Size | 22.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
127140694349cf7dcd85e9d32f6fa0f5fee0cff98e438f68b86306945b4c0034
|
|
BLAKE2b-256 checksum How to use checksums |
e4c543e5ce95d5d663154ce41965f20847fcb44e0e97d6472a8f6713a4a8ce79
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|