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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: aio-rom-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 bcf6a245aade5b6f5a8b4aafdb0ae7f17f490eb1b8c5e9157f1532215fb0c800
MD5 23bd8a7f8380024c525e53be45488aa9
BLAKE2b-256 53ccb1ada933e8209de70367fa4bcec937a746412244ba7a5e028af1d140f45d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aio_rom-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4e89b95618631544fd2f06be21bea567c35fb119cb2bf5d5472850bffad05ad8
MD5 ccdf1c64eb1ef552f07796c04bf39231
BLAKE2b-256 66b2c7137aa565dd6a3c97e04df5fa16bf76c67d9a675d5c07788cec12e2a9ac

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