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.5.tar.gz
(6.5 kB
view details)
Built Distribution
File details
Details for the file aio-rom-0.0.5.tar.gz
.
File metadata
- Download URL: aio-rom-0.0.5.tar.gz
- Upload date:
- Size: 6.5 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.59.0 CPython/3.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0173318715182304ea04f7a78822b6b602698a999eacc10805bcb857ce9da55 |
|
MD5 | 79b0b03b958a031b887da11496d9edac |
|
BLAKE2b-256 | 8f9aebe81f2378204f8156e7bef8794a585ef750b5c3ac61e3eca32b719e0929 |
File details
Details for the file aio_rom-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: aio_rom-0.0.5-py3-none-any.whl
- Upload date:
- Size: 8.7 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.59.0 CPython/3.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 879fde02e68c835ec8906ce6f54e5ee992bd9f3a2ef575636e0e0c9c1c95b3cc |
|
MD5 | b6f626d02359aa5712d68cf53327dadd |
|
BLAKE2b-256 | 412ed2f7fc337d70a59c7c19166507e7e917052d1125ddfee2ecdeff655afa4c |