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 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

  1. Docs
  2. Tests
  3. Pypi
  4. Update specific model fields

Limitations

  1. init 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.0.8.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

aio_rom-0.0.8-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aio-rom-0.0.8.tar.gz
  • Upload date:
  • Size: 6.8 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

Hashes for aio-rom-0.0.8.tar.gz
Algorithm Hash digest
SHA256 ece152333f316d1b1be2dc6c3b4fa3f01e3851c004aac66e712b8d503d1d4a51
MD5 8dbcf656e87551f91111869d02676071
BLAKE2b-256 f1d533bf16f46f09d2c68a348675978758e5c6850805d25f1e06953d3b937fdc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aio_rom-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 9.0 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

Hashes for aio_rom-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 dce4a6007d987bd73ff9104b2cb713f5d425c49f8565e15b8f5a6bf312ac30d7
MD5 f2aaef4aaab6ca3aeed0eaf5c9e029bf
BLAKE2b-256 88ffdfae91becd7bfd5ac8e2db0c61944388b4775af6dc3ab802f4c9713a85f3

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