aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/db_csvheader.py13
-rw-r--r--python/headers/bond_upload.py66
2 files changed, 68 insertions, 11 deletions
diff --git a/python/db_csvheader.py b/python/db_csvheader.py
index 4f286584..e476b305 100644
--- a/python/db_csvheader.py
+++ b/python/db_csvheader.py
@@ -14,14 +14,5 @@ if __name__ == "__main__":
with open(f"/home/serenitas/flint/{args.fname}.csv") as csvfile:
csvreader = csv.reader(csvfile)
for row in csvreader:
- sql_str = "INSERT INTO csv_templates values (%s, %s) ON CONFLICT DO NOTHING"
- with conn.cursor() as c:
- c.execute(sql_str, (args.fname, row))
- c.execute(
- "SELECT headers FROM csv_templates where template_name=%s",
- (args.fname,),
- )
- for row in c:
- print(row.headers)
- conn.commit()
- break
+ with open(f"headers/bond_upload.py", "w") as template_file:
+ template_file.write(f"{args.fname}={row}")
diff --git a/python/headers/bond_upload.py b/python/headers/bond_upload.py
new file mode 100644
index 00000000..8f068412
--- /dev/null
+++ b/python/headers/bond_upload.py
@@ -0,0 +1,66 @@
+bbh_bonds = [
+ "Function of Instruction",
+ "Client Reference Number",
+ "Previous Reference Number",
+ "Account Number",
+ "Transaction Type",
+ "Place of Settlement/Country",
+ "Place of Safekeeping",
+ "Trade Date",
+ "Settlement Date",
+ "Security ID",
+ "Security Description",
+ "Unit / Original Face Amount",
+ "Currency",
+ "Unit Price Amount",
+ "Net Amount",
+ "Trading Broker Type/ID",
+ "Trading Broker Description",
+ "Beneficiary of Securities Account",
+ "Clearing Broker ID / Type",
+ "Clearing Broker Description",
+ "Clearing Agent Account",
+ "Stamp Duty Code",
+ "Stamp Duty Amount",
+ "Special Settlement Type",
+ "Special Indicator #1",
+ "Special Indicator #2",
+ "Registration Details",
+ "Special Instruction",
+ "Originator of Message",
+ "Current Face/Amortize Value",
+ "Principal Amount",
+ "Interest Amount",
+ "Other Fees Amount",
+ "Commission Amount",
+ "SEC Fees Amount",
+ "Transaction Tax Amount",
+ "Withholding Tax Amount",
+ "Exchange Rate",
+ "Resulting Currency",
+ "Resulting Amount",
+ "FX Currency",
+ "Pool Reference Number",
+ "Total Group Number",
+ "Trade Number",
+ "Repo Term Date (REPO only)",
+ "Repo Amount (REPO only)",
+ "Repo Reference Number (REPO only)",
+ "Repo Rate (REPO Only)",
+ "Ticker (CPF and CRF Only)",
+ "Strike Price (CPF and CRF Only)",
+ "Expiration Date (CPF and CRF Only)",
+ "Broker Number (CPF and CRF Only)",
+ "Broker Account (CPF and CRF Only)",
+ "Contract Size (Option Contract and Future Contract Only)",
+ "Place of Trade Narrative",
+ "Common Reference",
+ "Partial Settlement Allowed",
+ "Partial Settlement Tolerance",
+ "No Automatic Market Claim",
+ "Corporate Action Coupon Option",
+ "Triparty Collateral Segregation",
+ "FX Cancel - For CANC instructions only",
+ "Fund Accounting Only Trade (RPTO)",
+ "Custody Only Trade (NACT)",
+]