Skip to content

Instantly share code, notes, and snippets.

View andersonkxiass's full-sized avatar
🏠
Working from home

Anderson Caxias andersonkxiass

🏠
Working from home
View GitHub Profile
@svmotha
svmotha / createTable.py
Created June 11, 2017 05:36
Check if DynamoDB table already exists and create one if it doesn't
import boto3
class tableCreate(object):
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
# Query client and list_tables to see if table exists or not
def queryCreate(self):
# Instantiate your dynamo client object
client = boto3.client('dynamodb')
@dnmellen
dnmellen / models.py
Last active October 3, 2021 04:14
DynamoDB mixin for Django models: Mix Django fields and DynamoDB fields in your models!
import uuid
import boto3
from decimal import Decimal
from functools import partial
from django.db import models
from django.conf import settings
class UUIDModel(models.Model):
"""
@parijatmishra
parijatmishra / ddb_lsi_example.py
Created February 10, 2016 11:51
Using DynamoDB Local Secondary Indexes - example in Python and boto3
#!/usr/bin/env python
# ddb_lsi_example: A sample program to show how to use Local Secondary Indexes
# in DynamoDB, using Python and boto3.
#
# Copyright 2016 Parijat Mishra
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0