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

1 Answer 1

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 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.