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.3.tar.gz
(6.4 kB
view details)
Built Distribution
File details
Details for the file aio-rom-0.0.3.tar.gz
.
File metadata
- Download URL: aio-rom-0.0.3.tar.gz
- Upload date:
- Size: 6.4 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.58.0 CPython/3.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0b16c6a611cc11fd8e188642313c191adf624be0ec56a5b91ad9b1b88e0fcdf |
|
MD5 | 8972c6d4a5f2b74d9b4379f099a1716c |
|
BLAKE2b-256 | b0707a4467293d0b7ddfa57d0cb732d4bb32cc6c7db4185353e95c8e21360c7e |
File details
Details for the file aio_rom-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: aio_rom-0.0.3-py3-none-any.whl
- Upload date:
- Size: 8.6 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.58.0 CPython/3.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72546fc7d7befb09ee8f3de76ebe8c064e525e6fff10c7f4014d47927abb8ec1 |
|
MD5 | ae0107f753e31a8fb020176794812ad8 |
|
BLAKE2b-256 | 0b9d854193b2cd8c990bdc6bf9e0ed0f4bbcb6f8acc0bfccd99c4d316e0a8802 |