Metadata-Version: 2.1
Name: finalsa-dynamo-dao
Version: 0.0.5
Summary: An utils package for using dynamodb
Home-page: https://github.com/finalsa/finalsa-dynamo-dao
Author: Luis Jimenez
Author-email: luis@finalsa.com
License: MIT
Keywords: dynamodb
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet :: WWW/HTTP
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 :: 3.10
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: boto3>=1.20.3

Dynamo Dao

## Description

This is a simple DynamoDB Dao that can be used to interact with DynamoDB. It is a simple wrapper around the AWS SDK for DynamoDB.

## Installation

```bash
pip install finalsa-dynamo-dao
```

## Usage

```python
from finalsa.dynamo.dao import DynamoDao

# Create a new model and its dao

class MyModelDao(DynamoDao):
    id:str
    name:str
    age:int
    created_at:datetime

class MyModelDao(DynamoDao):
    PK:str
    name:str
    age:int
    created_at:datetime
    ttl:int

# Create a mapper
def my_mapper(item:dict) -> MyModelDao:
    return MyModelDao(**item)

# Create a reverse mapper

def my_reverse_mapper(model:MyModelDao) -> dict:
    return model.dict()

```
