Skip to content

Converts DynamoDB's verbose JSON format to human-readable JSON by removing type descriptors and converting data types appropriately

Notifications You must be signed in to change notification settings

zjor/dynamo-db-deserializer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dynamo DB Deserializer

Converts DynamoDB's verbose JSON format to human-readable JSON by removing type descriptors and converting data types appropriately.

Description

Convert DynamoDB's verbose attribute value format (with "S", "N", "M", "L" type descriptors) to clean, regular JSON.

Purpose: Takes DynamoDB's native JSON format and strips away the type metadata, converting numbers from strings to actual numbers, maps from {"M": {...}} to {...}, etc.

Input/Output Example

Input (DynamoDB format):

{
  "Items": [
    {
      "name": {"S": "John"},
      "age": {"N": "30"},
      "active": {"BOOL": true}
    }
  ]
}

Output (Clean JSON):

{
  "Items": [
    {
      "name": "John",
      "age": 30,
      "active": true
    }
  ]
}

Installation

Global Installation (Recommended)

Install globally using pipx to make the dds command available system-wide:

# Install pipx if you don't have it
pip install --user pipx

# Install dds globally
pipx install .

Alternative Installation Methods

# Install with pip
pip install .

# Or install in user space
pip install --user .

Development Installation

# Install dependencies for development
poetry install

Usage

After global installation, use the dds command:

# Convert DynamoDB JSON format to clean JSON
cat dynamodb-data.json | dds

# Or pipe from any command
aws dynamodb scan --table-name MyTable | dds

# Example with echo
echo '{"Items": [{"name": {"S": "John"}, "age": {"N": "30"}}]}' | dds

Development Usage

# Run directly with poetry during development
cat dynamodb-data.json | poetry run python -m app.cli

About

Converts DynamoDB's verbose JSON format to human-readable JSON by removing type descriptors and converting data types appropriately

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages