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.2.tar.gz
(5.8 kB
view details)
Built Distribution
File details
Details for the file aio-rom-0.0.2.tar.gz
.
File metadata
- Download URL: aio-rom-0.0.2.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45101613d71b69f7ef0398617f3ac6d4fcd68a726956c05bc1fff1a1929608a4 |
|
MD5 | a7b983af5153d80e0b90ff55d4b19733 |
|
BLAKE2b-256 | d5604004c9ad8ded93981da72f61249b7c6e581332c15c28aa573643217899e0 |
File details
Details for the file aio_rom-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: aio_rom-0.0.2-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db1ce89779f272105633e314bbfec457fd97ee09c4e621fa9b9e4c1d19b646ec |
|
MD5 | beb6211cee606ee5fa3bd63b3c1ac479 |
|
BLAKE2b-256 | 589d58168e4b365cf310f5f91942cde08906f6779e3f798c5f2aee335562ed4b |