Last active
April 22, 2021 21:28
-
-
Save diogodilcl/ebbf4df5c3784bfd7df148f960fd0230 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import random | |
import string | |
import time | |
import uuid | |
import boto3 | |
client = boto3.client('kinesis') | |
for _ in range(1000): | |
data = { | |
'id': str(uuid.uuid4()), | |
'random_number': random.randint(60, 120), | |
'random_string': ''.join(random.choice(string.ascii_lowercase) for i in range(10)) | |
} | |
print(data) | |
response = client.put_record( | |
StreamName='data_streaming', | |
Data=json.dumps(data), | |
PartitionKey="partitionkey") | |
time.sleep(0.3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment