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

Uploaded Source

Built Distribution

aio_rom-0.1.6-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file aio_rom-0.1.6.tar.gz.

File metadata

  • Download URL: aio_rom-0.1.6.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for aio_rom-0.1.6.tar.gz
Algorithm Hash digest
SHA256 29ced110c6bbd95cf1cd121ce3354aa6a29ec4c04d3967b42c371e19a1da9bfe
MD5 1355b6b6ffce9618d8b919b5d64d3049
BLAKE2b-256 d23ec8e89d9aa0691e5dc3cb5d7f3f16e0cbf52202a9e05eb6ac096fcfa67b7a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aio_rom-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for aio_rom-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 7efa8b299a0665226e69c1883f7be5fdbd3018c32afc46d6a3dc29af7f15aabc
MD5 6484e0353de84736c765cc085d0c2e15
BLAKE2b-256 a6f983d463e5c47ac914458da39139ef9605c3c260c762e9babfe42b69d38864

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