NamedRedis by Ouroboros Coding
Named Redis: a simple wrapper for redis using config-oc to act as a factory for named connections
Install
pip install namedredis
Requires
namedredis requires python 3.10 or higher
Uses
namedredis uses the redis package and returns an instance of StrictRedis.
Using
example.py
from nredis import nr, reset
# Reference every time
nr('main').set('foo', 'bar')
# Store instance for multiple uses
main_redis = nr('main')
main_redis.set('hello', 'world!')
# Re-fetches a config and resets the connection
reset('main')
# Resets all open connections
reset()
config.json
{
"redis": {
"main": {
"host": "localhost",
"port": 6379,
"db": 0,
"protocol": 3
},
"secondary": {
"db": 1
}
}
}
Options
The following options all have defaults and don't necessarily need to be set. For more non-standard options, see redis.StrictRedis
| Name | Type | Default | Description |
|---|---|---|---|
| host | str | "localhost" | The IP or host name of the server |
| port | unsigned | 6379 | The port of the server |
| db | unsigned | 0 | The DB to connect to on the server |
| protocol | unsigned | 3 | The protocol version to use |
Metadata
Release files for namedredis 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| namedredis-1.0.2.tar.gz | 3.9 kB | Without provenance | Details for namedredis-1.0.2.tar.gz |
Release files / namedredis-1.0.2.tar.gz
| Download URL | namedredis-1.0.2.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d1a451e3731cfe26a8b714dbf14641306c5501f4d7fd4d0736ae3e38ee89aa6
|
|
BLAKE2b-256 checksum How to use checksums |
e1dc1b9e468f68a52ad8d5d46efb7fd9c5dd892d2f1f8e73b2d10cb0f55fdd6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.31.0 rfc3986/1.5.0 tqdm/4.65.0 urllib3/1.26.5 CPython/3.10.12
|
Security for namedredis 1.0.2
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.