Model Redis data structures
Project description
aioredis-models
A wrapper over aioredis that models Redis data as simple data structures.
Supported data structures
- Keys
- Strings
- Lists
- Hash maps
- Sets
- Double hash maps
Requirements
- Python 3.6+
- aioredis requirements
Documentation
Detailed documentation is available at https://aioredis-models.readthedocs.io/.
Usage
Construction of all data structures requires at least an aioredis.Redis
instance
and a key. For example, to create a RedisString
:
from aioredis-models import RedisString
redis_string = RedisString(redis, 'my-string')
Once a model has been constructed, various functions can be used to interact with it.
import aioredis
from aioredis-models import RedisString
async def do_work(redis_string: RedisString):
stored_value = await redis_string.get()
print(stored_value)
Contributing
The library is currently in very early stages of development and there is a lot of room for growth.
As such, contributions are welcome. To contribute, create a pull request into the main
branch.
Make sure the tests pass and there are no linting errors. Also, please update documentation, if
needed.
Testing
The easiest way to run the tests is to execute the ./test.sh
script.
This requires Docker to be installed and running. The following can be used to run
without Docker:
pip3 install -r requirements.txt
tox
Linting
Similar to testing, linting rules can be run by executing the ./lint.sh
script.
To run without Docker:
pip3 install -r requirements.txt
pylint aioredis_models
Documentation
Documentation can get regenerated using ./generate-docs.sh
script.
To run without Docker:
pip3 install -r requirements.txt
sphinx-apidoc -f -o docs/source aioredis_models && (cd docs && make html)
License
This library is offered under the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file aioredis-models-1.1.0.tar.gz
.
File metadata
- Download URL: aioredis-models-1.1.0.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5899b8b14908fd90f6b6d9fff7892b1a7ee8b9c069ce3f49707986d156e813a |
|
MD5 | a5958396cfab59ae5fdd2712d5ef740e |
|
BLAKE2b-256 | 4faa642566df991e364b5d9aaf9b3b98052f9885c0f656ba895752d93d80d8b3 |
File details
Details for the file aioredis_models-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: aioredis_models-1.1.0-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 065787c2b11f68926414bf90b25605267f81c3d7e7434e4cac35994b4f3264b4 |
|
MD5 | b3df417f74601f639779865312b0d973 |
|
BLAKE2b-256 | 1fa01ae14a241802ce422bca27b1f1f70865d40a7cef592916edf946698cbf42 |