diff --git a/sinks/aerospike/generate.py b/sinks/aerospike/generate.py new file mode 100644 index 0000000..54d82ae --- /dev/null +++ b/sinks/aerospike/generate.py @@ -0,0 +1,52 @@ +from faker import Faker +import csv +import random +from tqdm import tqdm + +fake = Faker() + +# Generate customers data +customers = [] +for i in tqdm(range(100000)): # Generate 100 customers + customer = [ + i, # Assuming customer_id starts at 0 + fake.first_name(), + fake.last_name(), + fake.date_of_birth(minimum_age=18, maximum_age=90).isoformat(), + fake.email(), + fake.phone_number(), + fake.address().replace('\n', ', '), # Replace newlines in address + fake.city(), + fake.state(), + fake.zipcode(), + fake.country(), + ] + customers.append(customer) + +print("customers completed") +# Write customers to CSV +with open('customers.csv', 'w', encoding='utf-8') as file: + writer = csv.writer(file, delimiter=',', lineterminator='\r\n', quoting=csv.QUOTE_NONNUMERIC) + writer.writerow(['customer_id', 'first_name', 'last_name', 'dob', 'email', 'phone_number', 'address', 'city', 'state', 'zip_code', 'country']) + writer.writerows(customers) + +# Generate transactions data +transactions = [] +for i in tqdm(range(5000000)): # Generate 500 transactions + transaction = [ + i, # Assuming transaction_id starts at 0 + random.randint(0, len(customers)), # Assuming customer IDs range from 0 to 99 + random.choice(['Deposit', 'Withdrawal', 'Transfer']), + round(random.uniform(10.00, 10000.00), 2), + 'USD', + fake.date_this_year().isoformat(), + random.choice(['Completed', 'Pending', 'Cancelled']), + fake.sentence(), + ] + transactions.append(transaction) + +# Write transactions to CSV +with open('transactions.csv', 'w', encoding='utf-8') as file: + writer = csv.writer(file, delimiter=',', lineterminator='\r\n', quoting=csv.QUOTE_NONNUMERIC) + writer.writerow(['transaction_id', 'customer_id', 'type', 'amount', 'currency', 'transaction_date', 'status', 'description']) + writer.writerows(transactions) \ No newline at end of file diff --git a/sinks/aerospike/poetry.lock b/sinks/aerospike/poetry.lock new file mode 100644 index 0000000..387d20e --- /dev/null +++ b/sinks/aerospike/poetry.lock @@ -0,0 +1,76 @@ +# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. + +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +files = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] + +[[package]] +name = "faker" +version = "22.6.0" +description = "Faker is a Python package that generates fake data for you." +optional = false +python-versions = ">=3.8" +files = [ + {file = "Faker-22.6.0-py3-none-any.whl", hash = "sha256:2b57f0256da6b45b7851dca87836ef5e2ae2fbb64d63d8697f1e47830d7b505d"}, + {file = "Faker-22.6.0.tar.gz", hash = "sha256:fa6d969728ef3da6229da91267a1bd4e6b902044c4822012d4fc46c71bb92b26"}, +] + +[package.dependencies] +python-dateutil = ">=2.4" + +[[package]] +name = "python-dateutil" +version = "2.8.2" +description = "Extensions to the standard Python datetime module" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +files = [ + {file = "python-dateutil-2.8.2.tar.gz", hash = "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"}, + {file = "python_dateutil-2.8.2-py2.py3-none-any.whl", hash = "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"}, +] + +[package.dependencies] +six = ">=1.5" + +[[package]] +name = "six" +version = "1.16.0" +description = "Python 2 and 3 compatibility utilities" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, + {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, +] + +[[package]] +name = "tqdm" +version = "4.66.1" +description = "Fast, Extensible Progress Meter" +optional = false +python-versions = ">=3.7" +files = [ + {file = "tqdm-4.66.1-py3-none-any.whl", hash = "sha256:d302b3c5b53d47bce91fea46679d9c3c6508cf6332229aa1e7d8653723793386"}, + {file = "tqdm-4.66.1.tar.gz", hash = "sha256:d88e651f9db8d8551a62556d3cff9e3034274ca5d66e93197cf2490e2dcb69c7"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "platform_system == \"Windows\""} + +[package.extras] +dev = ["pytest (>=6)", "pytest-cov", "pytest-timeout", "pytest-xdist"] +notebook = ["ipywidgets (>=6)"] +slack = ["slack-sdk"] +telegram = ["requests"] + +[metadata] +lock-version = "2.0" +python-versions = "^3.9" +content-hash = "694d847c3187525648aaee8125497c5ad28cbd5176f1d0ebbf208c0090f87448" diff --git a/sinks/aerospike/pyproject.toml b/sinks/aerospike/pyproject.toml new file mode 100644 index 0000000..9c1b895 --- /dev/null +++ b/sinks/aerospike/pyproject.toml @@ -0,0 +1,16 @@ +[tool.poetry] +name = "aerospike" +version = "0.1.0" +description = "" +authors = ["VG "] +readme = "README.md" + +[tool.poetry.dependencies] +python = "^3.9" +faker = "^22.6.0" +tqdm = "^4.66.1" + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api"