Skip to main content

asyncio based Redis object mapper

Reason this release was yanked:

wrong number

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

import rom
from rom.fields import Metadata


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


class OtherFoo(rom.Model):
    foo: Foo

async def main():
    async with rom.session.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.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

aio_rom-0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aio-rom-0.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.8.2 Linux/5.8.0-1039-azure

File hashes

Hashes for aio-rom-0.tar.gz
Algorithm Hash digest
SHA256 abb587a7c05d241c6ec86a4e986e7dead99d2950e0b815b51b8b583566193a53
MD5 9c02f63dc3752b9add5ba0e23429fb7f
BLAKE2b-256 b4d6dfc5fa78a8496790f6c5992e89065ace5d46b19f13eaca803e08a08ba4cb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aio_rom-0-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.8.2 Linux/5.8.0-1039-azure

File hashes

Hashes for aio_rom-0-py3-none-any.whl
Algorithm Hash digest
SHA256 0939c2a15bdafda297efe27957108f52e1f8cddf37e80eba485414554f114edf
MD5 59ce754b087581240620d47b9b123366
BLAKE2b-256 95af878ad18890bf8f6f5ad1aaa3e3cab11ac094beebf9a95e210c390706aa34

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