Metadata-Version: 2.1
Name: aio-rom
Version: 0
Summary: asyncio based Redis object mapper
Home-page: https://github.com/fedej/aio-rom
License: MIT
Author: Federico Jaite
Author-email: fede_654_87@hotmail.com
Requires-Python: >=3.7,<4.0
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Database :: Front-Ends
Provides-Extra: mypy
Requires-Dist: aioredis (==1.3.1)
Requires-Dist: mypy (>=0.910,<0.911); extra == "mypy"
Requires-Dist: typing-extensions (>=3.10.0.0,<4.0.0.0)
Project-URL: Repository, https://github.com/fedej/aio-rom
Description-Content-Type: text/markdown

Python Redis Object Mapper
======================

asyncio based Redis object mapper

## Table of content

- [Installation](#installation)
- [Usage](#usage)
- [Features](#usage)
- [TODO](#todo)
- [Limitations](#limitations)

## Installation

TODO

## Usage

```python
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
1. Tests

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

