Skip to content

Commit 52552ea

Browse files
committed
hotfix - support for folios with no KYC field
1 parent 8028421 commit 52552ea

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

casparser/process/cas_detailed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def process_detailed_text(text):
101101
"folio": current_folio,
102102
"amc": current_amc,
103103
"PAN": (m.group(2) or "").strip(),
104-
"KYC": m.group(3).strip(),
104+
"KYC": None if m.group(3) is None else m.group(3).strip(),
105105
"PANKYC": None if m.group(4) is None else m.group(4).strip(),
106106
"schemes": [],
107107
}

casparser/process/regex.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
SCHEME_TAIL_RE = r"(\n.+?)\t\t"
1111

1212
FOLIO_RE = (
13-
r"Folio\s+No\s*:\s+([\d/\s]+)\s+.*?(?:PAN\s*:\s+([A-Z]{5}\d{4}[A-Z])\s+)?.*?"
14-
r"KYC\s*:\s*(OK|NOT\s+OK)\s*.*?(?:PAN\s*:\s*(OK|NOT\s+OK))?$"
13+
r"Folio\s+No\s*:\s+([\d/\s]+)\s+.*?(?:PAN\s*:\s*([A-Z]{5}\d{4}[A-Z])\s+)?.*?"
14+
r"(?:KYC\s*:\s*(OK|NOT\s+OK))?\s*.*?(?:PAN\s*:\s*(OK|NOT\s+OK))?$"
1515
)
1616

1717
SCHEME_RE = r"([\s\w]+)-\s*\d*\s*(.+?)\s*(?:\(Advisor\s*:\s*(.+?)\))*\s+Registrar\s*:\s*(.*)\s*$"

0 commit comments

Comments
 (0)