import json import spotify_charts_daily_top_songs def handler(event, context): records = event.get('Records') if records is None: return for r in records: if 'dynamodb' not in r: continue if 'eventName' not in r: continue feed_name = r['dynamodb']['Keys']['feed_name']['S'] if feed_name == 'spotify_charts_daily_top_songs': spotify_charts_daily_top_songs.handle_record(r) if __name__ == '__main__': with open('input2.json', 'r') as f: data = json.load(f) json_str = json.dumps(data, indent=2) print(json_str) handler(data, None)