Skip to main content

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 dataclasses import field
from typing import Set, Dict

from aio_rom import Model
from aio_rom.fields import Metadata
from aio_rom.session import redis_pool


class Foo(Model):
    bar: int
    foobar: Set[int] = field(default_factory=set)
    my_boolean: bool = False
    transient_field: Dict = field(metadata=Metadata(transient=True))


class OtherFoo(Model):
    foo: Foo

async def main():
    async with redis_pool("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

  1. Docs
  2. Tests

Limitations

  1. configure must be called before other calls to Redis can succeed, no defaults to localhost atm.
  2. You cannot use from __future__ import annotations in the same file you define your models. See https://bugs.python.org/issue39442
  3. TODO Supported datatypes
  4. Probably more ...

Project details


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.3.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

aio_rom-0.1.3-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file aio-rom-0.1.3.tar.gz.

File metadata

  • Download URL: aio-rom-0.1.3.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0a2 CPython/3.10.2 Linux/5.11.0-1028-azure

File hashes

Hashes for aio-rom-0.1.3.tar.gz
Algorithm Hash digest
SHA256 4a2b0281da4954a81cf0f3d464cda5aa0c8875d162dea52c069e60ca2bba3966
MD5 de8d6a07dd7e7deb67df2acf7533bf8d
BLAKE2b-256 661d478e4829ade4d48f144ab36171a2721903803c86bf6243091608dbe1f07f

See more details on using hashes here.

File details

Details for the file aio_rom-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: aio_rom-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0a2 CPython/3.10.2 Linux/5.11.0-1028-azure

File hashes

Hashes for aio_rom-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 96ca1ac0730a3a33c604fe8114aced015d49f7a00deee784b51b55681a52ca4f
MD5 74cd33c53308be94ac1e01f3986e3244
BLAKE2b-256 e633be4511617eeed7936a38316622957470ddb48f5bcaad4a8307b4e7cb4e27

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page