asyncio based Redis object mapper
Project description
Python Redis Object Mapper
asyncio based Redis object mapper
Table of content
Installation
TODO
Usage
import asyncio
from typing import Set
import rom
# Library will wrap the class into a dataclass and detect fields from that
class Foo(rom.Model):
bar: int
foobar: Set[int] = rom.field(default_factory=set)
my_boolean: bool = False
transient_field: Dict = rom.field(transient=True)
class OtherFoo(rom.Model):
foo: Foo
async def main():
await rom.init("redis://localhost")
foo = Foo(123, {1,2,3}, True)
await foo.save()
...
foo2 = await Foo.get(321)
other_foo = OtherFoo(303, foo2)
await other_foo.save()
asyncio.run(main())
Features
TODO
TODO
- Docs
- Tests
- Pypi
- Update specific model fields
Limitations
init
must be called before other calls to Redis can succeed, no defaults to localhost atm.- You cannot use
from __future__ import annotations
in the same file you define your models. See https://bugs.python.org/issue39442 - TODO Supported datatypes
- Probably more ...
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
aio-rom-0.0.9.tar.gz
(13.3 kB
view details)
Built Distribution
File details
Details for the file aio-rom-0.0.9.tar.gz
.
File metadata
- Download URL: aio-rom-0.0.9.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.0 importlib_metadata/3.7.3 packaging/20.9 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c20ba68fdd7d870ac1b8e2c9f78b255d81d29fb4321668d0a9236d879aa3430 |
|
MD5 | 8069378a3f096830ae763bcdce6ee404 |
|
BLAKE2b-256 | 714554b25a5ba770f13e6531cdb46bd9e76ed27360d37e679d897ef662fc9e63 |
File details
Details for the file aio_rom-0.0.9-py3-none-any.whl
.
File metadata
- Download URL: aio_rom-0.0.9-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.0 importlib_metadata/3.7.3 packaging/20.9 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f354237d6ab1a469a87543aa5ad764922a0e88f496f577a6f4a8a66eaa7923d0 |
|
MD5 | 711bb870cdff2b33ef3ce788f427351a |
|
BLAKE2b-256 | 7379e68d05277e0bafb364ca6a55b0f25938fbc2d633b8e08cd7891b771d6e2a |