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
initmust be called before other calls to Redis can succeed, no defaults to localhost atm.- You cannot use
from __future__ import annotationsin 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.4.tar.gz
(6.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aio-rom-0.0.4.tar.gz.
File metadata
- Download URL: aio-rom-0.0.4.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 |
866915cb2e158ed2284269cc34cb7c5182932866e58409e70799be5f6b823cba
|
|
| MD5 |
b760215c8624f69b1aa1a992aeefa067
|
|
| BLAKE2b-256 |
36cab437c7da326b9afc5feb983084aa1ee8b8b233cc662ae40a92c21c5db04f
|
File details
Details for the file aio_rom-0.0.4-py3-none-any.whl.
File metadata
- Download URL: aio_rom-0.0.4-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 |
b7923d4b69112d2270aebf4718d223f27c69af016b8dad9255a6e303cea10bd8
|
|
| MD5 |
3bdc5ffb5815bdddf917b177d9c6cdc8
|
|
| BLAKE2b-256 |
2381b1d671ee34ef00b15099f88ffe4954e3152bf243a631f373cdf8bdbe95bc
|