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.1.0.tar.gz
(14.6 kB
view details)
Built Distribution
aio_rom-0.1.0-py3-none-any.whl
(11.1 kB
view details)
File details
Details for the file aio-rom-0.1.0.tar.gz
.
File metadata
- Download URL: aio-rom-0.1.0.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9642694ce922a8fe55a53562602917cf94c1b70dd2993e5499501d34a066b56b |
|
MD5 | 2fc3c0f1561f1ba7646ae7da16a8aecc |
|
BLAKE2b-256 | c70149bbb5b70eca6801d254d46134f2f025885db4f5d107ed4b099dbfbbe86e |
File details
Details for the file aio_rom-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: aio_rom-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2419c2c6d17567e76abcf0cb1f9701fccf7cf481f6f3f984a7e94ab104c38358 |
|
MD5 | 2d57acdbc48557e72cc073f596146156 |
|
BLAKE2b-256 | f218583340f0bdee30845d6703f214eea1aea9bae147122bb3a9c03ab08528d2 |