Redis Mass Get
Queries your Redis using KEYS and MGET to write the key/value to the stdout or a file. It supports the formats: text, json and csv.
Installation
Install from PIP:
pip install redis-mass-get
CLI usage
The project can be used as a CLI tool:
usage: redis-mass-get [-h] [-q] [-f {text,csv,json}] [-d DESTINATION] [-jd] [-c CHUNCKS] [-och] url key
Queries Redis using KEYS and MGET. This will efficiently retreive all keys and values. They can be stored/visualized in different modes: - text (default): odd lines are keys, even lines values. - csv: comma-separated format. - json: JSON-array. Use -jd to decode the JSON value.
positional arguments:
url Full Redis URL.
key The key to query on.
optional arguments:
-h, --help show this help message and exit
-q, --quiet Don't show information about the progress.
-f {text,csv,json}, --format {text,csv,json}
The format in which the keys of values should be.
-d DESTINATION, --destination DESTINATION
Writes the output to a file.
-jd, --json_decode Enables JSON decode when writing to JSON.
-c CHUNCKS, --chuncks CHUNCKS
How many keys should be queried at once? Default is 10,000.
-och, --omit_csv_header
Don't render a CSV header.
The alias rmg or redis_mass_get will work as well in the console.
API
The API can be used like this:
from redis_mass_get import RedisQuery
# pluralize will return the result or None
q = RedisQuery("redis://my.amazing.redis.url")
# query data
data = q.query("prefix*")
# data is returned as:
# [(key1, value1), (key2, value2)]
# write data to file
# TXT:
q.query_and_write_csv(self, "prefix*", "my.file.path.txt")
# CSV:
q.query_and_write_csv(self, "*postfix", "my.file.path.csv")
# JSON
q.query_and_write_csv(self, "*contains*", "my.file.path.csv", parse_value_as_json=True)
You could also write your own implementation of ProcessorBase and call query_with_processor.
Development
If you want to contribute to local development, please consult the local development page. More information on the reasoning behind this package can be found at this blog: Reading multiple key/values from Redis.
Metadata
Release files for redis-mass-get 0.0.11
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 |
|---|---|---|---|---|
| redis-mass-get-0.0.11.tar.gz | 6.7 kB | Without provenance | Details for redis-mass-get-0.0.11.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| redis_mass_get-0.0.11-py3-none-any.whl | Python 3 | none | any | Details for redis_mass_get-0.0.11-py3-none-any.whl |
Total release size: 15.7 kB
Release files / redis-mass-get-0.0.11.tar.gz
| Download URL | redis-mass-get-0.0.11.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d084fef1e106ca18ec3049f05a8f4151017eca9bf6a92d45acb55619e11d9b93
|
|
BLAKE2b-256 checksum How to use checksums |
a549381336e4d7dcd13665329a57e7f6876053ca3b0444ef32cdb0fb59710559
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.1
|
Release files / redis_mass_get-0.0.11-py3-none-any.whl
| Download URL | redis_mass_get-0.0.11-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a9344691dd3ec8d8c7e27c7f710f14f9ee8270e1184685efd5ee66efd16f62ce
|
|
BLAKE2b-256 checksum How to use checksums |
d603d7c59a687cb5bb9391fe0c2ba9cf999b8fed6799fdd2de96146a94648f0c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.1
|
Security for redis-mass-get 0.0.11
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.