Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
C='TTL'
B='Uses'
import boto3
G=boto3.resource('dynamodb')
def A(event,context):
L='Hash';K=event[L];C=G.Table('hash_lookup');D={}
for E in K:
A=C.get_item(Key={L:E})['Item']
if not A['Verified']:F=H(A);C.put_item(Item=F)
if B in A:A[B]=A[B]+1
else:A[B]=1
C.put_item(Item=A);A=I(A);D[E]=A
return{'statusCode':200,'body':D}
def H(row):
A=row
if A[B]>=5:
if C in A:del A[C]
return A
def I(row):
A=row
if C in A:del A[C]
if B in A:del A[B]
return A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment