This file contains hidden or 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
| from argparse import ArgumentParser | |
| def parse_command_line_args(): | |
| arg_parser = ArgumentParser() | |
| arg_parser.add_argument("--topic", required=True, help="Topic name") | |
| arg_parser.add_argument("--bootstrap-servers", required=False, default="localhost:9092", help="Bootstrap server address") | |
| arg_parser.add_argument("--schema-registry", required=False, default="http://localhost:8081", help="Schema Registry url") | |
| arg_parser.add_argument("--schema-file", required=False, help="File name of Avro schema to use") |
This file contains hidden or 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
| from confluent_kafka.avro import AvroConsumer | |
| from utils.parse_command_line_args import parse_command_line_args | |
| def consume_record(args): | |
| default_group_name = "default-consumer-group" | |
| consumer_config = {"bootstrap.servers": args.bootstrap_servers, | |
| "schema.registry.url": args.schema_registry, |
This file contains hidden or 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
| #!/usr/bin/env python | |
| import json | |
| import uuid | |
| from confluent_kafka.avro import AvroProducer | |
| from utils.load_avro_schema_from_file import load_avro_schema_from_file | |
| from utils.parse_command_line_args import parse_command_line_args |
This file contains hidden or 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
| from confluent_kafka import avro | |
| def load_avro_schema_from_file(schema_file): | |
| key_schema_string = """ | |
| {"type": "string"} | |
| """ | |
| key_schema = avro.loads(key_schema_string) | |
| value_schema = avro.load("./avro/" + schema_file) |
This file contains hidden or 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
| from argparse import ArgumentParser | |
| def parse_command_line_args(): | |
| arg_parser = ArgumentParser() | |
| arg_parser.add_argument("--topic", required=True, help="Topic name") | |
| arg_parser.add_argument("--bootstrap-servers", required=False, default="localhost:9092", help="Bootstrap server address") | |
| arg_parser.add_argument("--schema-registry", required=False, default="http://localhost:8081", help="Schema Registry url") | |
| arg_parser.add_argument("--schema-file", required=True, help="File name of Avro schema to use") |
This file contains hidden or 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
| confluent-kafka[avro]==1.4.0 |
This file contains hidden or 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 argparse | |
| import json | |
| import os | |
| from pprint import pprint | |
| import requests | |
| FIREBASE_WEB_API_KEY = os.environ.get("FIREBASE_WEB_API_KEY") | |
| rest_api_url = "https://identitytoolkit.googleapis.com/v1/accounts:sendOobCode" |
This file contains hidden or 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 argparse | |
| from firebase_admin import auth | |
| from firebase_admin.auth import UserRecord | |
| from initialise_firebase_admin import app | |
| def get_args(): | |
| parser = argparse.ArgumentParser(description="Set user password in Firebase") |
This file contains hidden or 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 argparse | |
| from firebase_admin import auth | |
| from initialise_firebase_admin import app | |
| def get_user_id_arg(): | |
| parser = argparse.ArgumentParser(description="Delete user in Firebase") | |
| parser.add_argument("--user-id", required=True, help="The user id of the user to be deleted.") |
This file contains hidden or 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 argparse | |
| import json | |
| import os | |
| import requests | |
| import pprint | |
| FIREBASE_WEB_API_KEY = os.environ.get("FIREBASE_WEB_API_KEY") | |
| rest_api_url = f"https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword" | |