-1

Actually the same question as this. but I need solution for Python. Does AWS Python SDK support converting DynamoDB docs to JSON within Python Lambda function? In other words I need something like dynamodb-json lib within my Lambda.

VB_
  • 45,112
  • 42
  • 145
  • 293

1 Answers1

1

you can do something like this :

from boto3.dynamodb.types import TypeDeserializer


def _deserialize(raw_data):
    result = {}
    if not raw_data:
        return result

    deserializer = TypeDeserializer()

    for key, val in raw_data.items():
       result[key] = deserializer.deserialize(val)

    return result 
Reza Nasiri
  • 1,360
  • 1
  • 6
  • 19