irshadtech10's picture
Upload data.py
58b3467
import json
import pandas as pd
data_json = '''
[
{
"user_id": 1,
"bankStatement": {
"accountHolder": "John Doe",
"bank": "Example Bank",
"accountNumber": "123-456-789",
"statementPeriod": "01/08/2023 - 31/08/2023",
"transactions": [
{
"date": "01/08/2023",
"description": "Opening Balance",
"debit": 100,
"credit": 0,
"balance": 5000
},
{
"date": "02/08/2023",
"description": "ATM Withdrawal",
"debit": 200,
"credit": 0,
"balance": 4800
},
{
"date": "10/08/2023",
"description": "Grocery Shopping",
"debit": 50,
"credit": 0,
"balance": 4750
},
{
"date": "15/08/2023",
"description": "Salary Deposit",
"debit": 0,
"credit": 3000,
"balance": 7750
},
{
"date": "20/08/2023",
"description": "Utility Bill Payment",
"debit": 100,
"credit": 0,
"balance": 7650
},
{
"date": "1/09/2023",
"description": "Online Purchase",
"debit": 300,
"credit": 0,
"balance": 7620
},
{
"date": "10/09/2023",
"description": "Rent Payment",
"debit": 1500,
"credit": 0,
"balance": 6120
}
]
},
"investmentStatement": {
"accountHolder": "John Doe",
"investmentFirm": "Example Investments",
"accountNumber": "INV-123456",
"statementPeriod": "01/08/2023 - 31/10/2023",
"transactions": [
{
"date": "01/08/2023",
"description": "Opening Balance",
"buy": 100,
"sell": 0,
"dividends": 10,
"balance": 10000
},
{
"date": "05/08/2023",
"description": "Buy ABC Corp Shares",
"buy": 400,
"sell": 0,
"dividends": 50,
"balance": 9600
},
{
"date": "12/09/2023",
"description": "Sell XYZ Corp Shares",
"buy": 290,
"sell": 300,
"dividends": 100,
"balance": 9900
},
{
"date": "18/09/2023",
"description": "Dividend Income",
"buy": 0,
"sell": 0,
"dividends": 200,
"balance": 10100
},
{
"date": "25/10/2023",
"description": "Buy DEF Corp Shares",
"buy": 200,
"sell": 0,
"dividends": 290,
"balance": 10300
},
{
"date": "31/10/2023",
"description": "Sell PQR Corp Shares",
"buy": 0,
"sell": 500,
"dividends": 0,
"balance": 10800
},
{
"date": "31/10/2023",
"description": "Buy MNO Corp Shares",
"buy": 300,
"sell": 0,
"dividends": 180,
"balance": 11100
}
]
},
"debts": [
{
"creditor": "Credit Card Company",
"debtType": "Credit Card Debt",
"amount": 4000,
"interestRate": 0.18,
"dueDate": "15/09/2023"
},
{
"creditor": "Student Loan Provider",
"debtType": "Student Loan",
"amount": 12000,
"interestRate": 0.05,
"dueDate": "30/06/2024"
}
],
"savingsRate": 0.20,
"retirementAge": 65,
"lifeExpectancy": 85,
"currentAge": 40,
"investmentReturns": 0.07
},
{
"user_id": 2,
"bankStatement": {
"accountHolder": "Jane Smith",
"bank": "Example Bank",
"accountNumber": "987-654-321",
"statementPeriod": "01/08/2023 - 31/08/2023",
"transactions": [
{
"date": "01/08/2023",
"description": "Opening Balance",
"debit": 0,
"credit": 0,
"balance": 7500
},
{
"date": "05/08/2023",
"description": "Salary Deposit",
"debit": 0,
"credit": 3000,
"balance": 10500
},
{
"date": "10/08/2023",
"description": "Grocery Shopping",
"debit": 70,
"credit": 0,
"balance": 10430
},
{
"date": "15/09/2023",
"description": "Utility Bill Payment",
"debit": 80,
"credit": 0,
"balance": 10350
},
{
"date": "20/08/2023",
"description": "Online Purchase",
"debit": 40,
"credit": 0,
"balance": 10310
},
{
"date": "28/09/2023",
"description": "Car Loan Payment",
"debit": 800,
"credit": 0,
"balance": 9510
},
{
"date": "31/10/2023",
"description": "Dining Out",
"debit": 100,
"credit": 0,
"balance": 9410
}
]
},
"investmentStatement": {
"accountHolder": "Jane Smith",
"investmentFirm": "Example Investments",
"accountNumber": "INV-987654",
"statementPeriod": "01/08/2023 - 31/08/2023",
"transactions": [
{
"date": "01/08/2023",
"description": "Opening Balance",
"buy": 0,
"sell": 0,
"dividends": 150,
"balance": 12000
},
{
"date": "05/08/2023",
"description": "Buy ABC Corp Shares",
"buy": 600,
"sell": 0,
"dividends": 200,
"balance": 11400
},
{
"date": "12/08/2023",
"description": "Sell XYZ Corp Shares",
"buy": 0,
"sell": 400,
"dividends": 50,
"balance": 11800
},
{
"date": "18/08/2023",
"description": "Dividend Income",
"buy": 0,
"sell": 0,
"dividends": 250,
"balance": 12050
},
{
"date": "25/08/2023",
"description": "Buy DEF Corp Shares",
"buy": 300,
"sell": 0,
"dividends": 120,
"balance": 11750
},
{
"date": "10/09/2023",
"description": "Sell PQR Corp Shares",
"buy": 0,
"sell": 700,
"dividends": 70,
"balance": 12450
},
{
"date": "1/09/2023",
"description": "Buy MNO Corp Shares",
"buy": 200,
"sell": 0,
"dividends": 20,
"balance": 12650
}
]
},
"debts": [
{
"creditor": "Credit Card Company",
"debtType": "Credit Card Debt",
"amount": 2500,
"interestRate": 0.15,
"dueDate": "20/11/2023"
},
{
"creditor": "Auto Loan Provider",
"debtType": "Auto Loan",
"amount": 8000,
"interestRate": 0.07,
"dueDate": "05/04/2025"
}
],
"savingsRate": 0.25,
"retirementAge": 68,
"lifeExpectancy": 90,
"currentAge": 45,
"investmentReturns": 0.08
}
]
'''