Skip to content

Commit 80850c3

Browse files
committed
Fix KeyError in NSDL parser for missing standalone MF entries
Signed-off-by: brf153 <[email protected]>
1 parent 42aa4cb commit 80850c3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

casparser/process/nsdl_statement.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ def process_nsdl_text(text):
8585
continue
8686
if current_demat is None:
8787
if m := re.search(DEMAT_MF_TYPE_RE, line.strip(), flags=re.I):
88-
current_demat = demat[(None, None)]
88+
if (None, None) in demat:
89+
current_demat = demat[(None, None)]
90+
else:
91+
continue
8992

9093
if "ACCOUNT HOLDER" in line.upper():
9194
for owner, pan in re.findall(DEMAT_AC_HOLDER_RE, line, re.I):

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ dependencies = [
2323
"python-dateutil>=2.8.2,<3",
2424
"rich>=13.5.2,<14",
2525
"pydantic>=2.3.0,<3",
26+
"PyMuPDF>=1.24.10,<2",
2627
]
2728
dynamic = ["version"]
2829

0 commit comments

Comments
 (0)