All Projects → Alonreznik → Dynamodb Json

Alonreznik / Dynamodb Json

Licence: mpl-2.0
DynamoDB json util to load and dump strings of Dynamodb json format to python object and vise-versa

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Dynamodb Json

Dialetus Service
API to Informal dictionary for the idiomatic expressions that each Brazilian region It has
Stars: ✭ 202 (+77.19%)
Mutual labels:  aws, serverless, json, dynamodb
Dynamodb Toolbox
A simple set of tools for working with Amazon DynamoDB and the DocumentClient
Stars: ✭ 752 (+559.65%)
Mutual labels:  aws, serverless, dynamodb
Aws Mobile React Sample
A React Starter App that displays how web developers can integrate their front end with AWS on the backend. The App interacts with AWS Cognito, API Gateway, Lambda and DynamoDB on the backend.
Stars: ✭ 650 (+470.18%)
Mutual labels:  aws, serverless, dynamodb
Serverless
This is intended to be a repo containing all of the official AWS Serverless architecture patterns built with CDK for developers to use. All patterns come in Typescript and Python with the exported CloudFormation also included.
Stars: ✭ 1,048 (+819.3%)
Mutual labels:  aws, serverless, dynamodb
Nodb
NoDB isn't a database.. but it sort of looks like one.
Stars: ✭ 353 (+209.65%)
Mutual labels:  aws, serverless, json
Dazn Lambda Powertools
Powertools (logger, HTTP client, AWS clients, middlewares, patterns) for Lambda functions.
Stars: ✭ 501 (+339.47%)
Mutual labels:  aws, serverless, dynamodb
Graphql Serverless
Sample project to guide the use of GraphQL and Serverless Architecture.
Stars: ✭ 28 (-75.44%)
Mutual labels:  aws, serverless, dynamodb
Aws Mobile React Native Starter
AWS Mobile React Native Starter App https://aws.amazon.com/mobile
Stars: ✭ 2,247 (+1871.05%)
Mutual labels:  aws, serverless, dynamodb
Contacts api
Serverless RESTful API with AWS Lambda, API Gateway and DynamoDB
Stars: ✭ 66 (-42.11%)
Mutual labels:  aws, serverless, dynamodb
Json Serverless
Transform a JSON file into a serverless REST API in AWS cloud
Stars: ✭ 108 (-5.26%)
Mutual labels:  aws, serverless, json
Lambda Refarch Webapp
The Web Application reference architecture is a general-purpose, event-driven, web application back-end that uses AWS Lambda, Amazon API Gateway for its business logic. It also uses Amazon DynamoDB as its database and Amazon Cognito for user management. All static content is hosted using AWS Amplify Console.
Stars: ✭ 1,208 (+959.65%)
Mutual labels:  aws, serverless, dynamodb
Komiser
☁️ Cloud Environment Inspector 👮🔒 💰
Stars: ✭ 2,684 (+2254.39%)
Mutual labels:  aws, serverless, dynamodb
Serverless Analytics
Track website visitors with Serverless Analytics using Kinesis, Lambda, and TypeScript.
Stars: ✭ 219 (+92.11%)
Mutual labels:  aws, serverless, dynamodb
Serverless Dynamodb Local
Serverless Dynamodb Local Plugin - Allows to run dynamodb locally for serverless
Stars: ✭ 530 (+364.91%)
Mutual labels:  aws, serverless, dynamodb
This Or That
This or that - Real-time atomic voting app built with AWS Amplify
Stars: ✭ 87 (-23.68%)
Mutual labels:  aws, serverless, dynamodb
Workshop Donkeytracker
Workshop to build a serverless tracking application for your mobile device with an AWS backend
Stars: ✭ 27 (-76.32%)
Mutual labels:  aws, serverless, dynamodb
Sqs Worker Serverless
Example for SQS Worker in AWS Lambda using Serverless
Stars: ✭ 164 (+43.86%)
Mutual labels:  aws, serverless, dynamodb
Realworld Dynamodb Lambda
λ serverless backend implementation for RealWorld using AWS DynamoDB + Lambda
Stars: ✭ 185 (+62.28%)
Mutual labels:  aws, serverless, dynamodb
Aws Testing Library
Chai (https://chaijs.com) and Jest (https://jestjs.io/) assertions for testing services built with aws
Stars: ✭ 52 (-54.39%)
Mutual labels:  aws, serverless, dynamodb
Historical
A serverless, event-driven AWS configuration collection service with configuration versioning.
Stars: ✭ 85 (-25.44%)
Mutual labels:  aws, serverless, dynamodb

DynamoDB Json

DynamoDB json util to load and dump strings of Dynamodb json format to python object and vise-versa

Install

just use pip:

pip install dynamodb-json

Use

The dynamodb-json util works the same as json loads and dumps functions:

import time
import uuid
from datetime import datetime
from decimal import Decimal

from dynamodb_json import json_util as json

json_ = {"MyString": "a",
         "num": 4,
         "MyBool": False,
         "my_dict": {"my_date": datetime.utcnow()},
         "MyNone": None,
         "MyZero": 0,
         "myDecimal": Decimal("19.2"),  # converts Decimal to float, load it as float
         "myLong": long(1938475658493),
         "MyNestedDict": {
             "my_other_nested": {
                 "name": "John",
                 "surname": "Lennon",
                 "MyOtherNone": None,
                 "floaty": float(29.4),
                 "myList": [1, 3, 4, 5, 6, "This Is Sparta!"],
                 "mySet": {1, 3, 4, 5, 6},  # converts set to list, returns as list
                 "myUUID": uuid.uuid4(),  # converts uuid to string, loads it as string
                 "time": time.time()  # converts it to seconds python float, loads it as float
             }
         }
    }

dynamodb_json = json.dumps(json_)

# {
# "my_dict": {"M": {"my_date": {"S": "2017-04-22T14:41:35.780000"}}}, 
# "MyBool": {"BOOL": false}, "MyNone": {"NULL": true}, 
# "MyNestedDict": {
#   "M": {"my_other_nested": {
#       "M": {"myUUID": {"S": "2f4ad21e098f49b18e22ad209779048b"}, 
#             "surname": {"S": "Lennon"}, "name": {"S": "John"}, 
#             "mySet": {"L": [{"N": "1"}, {"N": "3"}, {"N": "4"}, {"N": "5"}, {"N": "6"}]}, 
#             "floaty": {"N": "29.4"}, "time": {"N": "1492872095.78"}, 
#             "myList": {"L": [{"N": "1"}, {"N": "3"}, {"N": "4"}, {"N": "5"}, {"N": "6"}, {"S": "This Is Sparta!"}]}, 
#             "MyOtherNone": {"NULL": true}}
#             }
#       }
#   }, 
# "myDecimal": {"N": "19.2"}, "num": {"N": "4"}, 
# "MyString": {"S": "a"}, 
# "myLong": {"N": "1938475658493"}, 
# "MyZero": {"N": "0"}
# }


json.loads(dynamodb_json)

# {'my_dict': {'my_date': datetime.datetime(2017, 4, 22, 14, 41, 35, 780000)}, 'MyBool': False, 'MyNone': None,
#  'MyNestedDict': {
#      'my_other_nested': {'myUUID': '2f4ad21e098f49b18e22ad209779048b', 
#                          'surname': 'Lennon', 'name': 'John',
#                          'mySet': [1, 3, 4, 5, 6], 
#                          'floaty': 29.4, 
#                          'time': 1492872095.78,
#                          'myList': [1, 3, 4, 5, 6, 'This Is Sparta!'], 
#                          'MyOtherNone': None
#                          }
#              }, 
#  'myDecimal': 19.2,
#  'num': 4, 
#  'MyString': 'a', 
#  'myLong': 1938475658493L, 
#  'MyZero': 0
# }
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].