Converts DynamoDB's verbose JSON format to human-readable JSON by removing type descriptors and converting data types appropriately.
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 (DynamoDB format):
{
"Items": [
{
"name": {"S": "John"},
"age": {"N": "30"},
"active": {"BOOL": true}
}
]
}
Output (Clean JSON):
{
"Items": [
{
"name": "John",
"age": 30,
"active": true
}
]
}
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 .
# Install with pip
pip install .
# Or install in user space
pip install --user .
# Install dependencies for development
poetry install
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
# Run directly with poetry during development
cat dynamodb-data.json | poetry run python -m app.cli