Skip to main content

An utils package for using dynamodb

Project description

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

pip install finalsa-dynamo-dao

Usage

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

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

finalsa_dynamo_dao-0.1.0.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

finalsa_dynamo_dao-0.1.0-py3-none-any.whl (5.8 kB view hashes)

Uploaded Python 3

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