Skip to content

Commit 8530e2b

Browse files
committed
Fake credit card data.
1 parent 15947b5 commit 8530e2b

7 files changed

Lines changed: 20561 additions & 42 deletions

File tree

doc/image/tux-supports-stone.jpeg

103 KB
Loading

doc/linux-2.tex

Lines changed: 201 additions & 40 deletions
Large diffs are not rendered by default.

generate-fake-bank-data.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env python3
2+
import os
3+
from random import randint, choice, uniform
4+
from sys import stdout
5+
from uuid import uuid4
6+
7+
8+
def main() -> None:
9+
"""
10+
Generate fake bank data
11+
"""
12+
# banks IDs
13+
bank_ids = tuple(range(1, 116))
14+
# Customer IDs
15+
customer_ids = tuple(range(1, 1367))
16+
# Header of the files
17+
header = '''"transaction_id","bank_id","customer_id","amount"\n'''
18+
# Generate the data printing it to the console
19+
stdout.write(header)
20+
for _ in range(0, randint(10_000, 11_000)):
21+
amount = round(uniform(-10_000, 10_000), 2)
22+
bank_id = choice(bank_ids)
23+
customer_id = choice(customer_ids)
24+
# Generate a random transaction ID using UUID
25+
transaction_id = str(uuid4())
26+
try:
27+
stdout.write(f'''"{transaction_id}",{bank_id},{customer_id},{amount}\n''')
28+
stdout.flush()
29+
except BrokenPipeError:
30+
# Python flushes standard streams on exit; redirect to /dev/null
31+
devnull = os.open(os.devnull, os.O_WRONLY)
32+
os.dup2(devnull, stdout.fileno())
33+
34+
35+
if __name__ == '__main__':
36+
main()

porteur.csv

Lines changed: 10059 additions & 0 deletions
Large diffs are not rendered by default.

receveur.csv

Lines changed: 10263 additions & 0 deletions
Large diffs are not rendered by default.

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CheckMyTex
1+
CheckMyTex

style

Submodule style updated 1 file

0 commit comments

Comments
 (0)