Skip to content

feat(cdsl): parse NPS holdings (holdings-only)#143

Merged
codereverser merged 3 commits into
mainfrom
feat/nps-cdsl
Jul 6, 2026
Merged

feat(cdsl): parse NPS holdings (holdings-only)#143
codereverser merged 3 commits into
mainfrom
feat/nps-cdsl

Conversation

@codereverser

Copy link
Copy Markdown
Owner

Adds support for NPS holdings (CDSL only)

  nps: {                                 // National Pension System, if present (CDSL)
    pran: string | null,                 // PRAN (as printed; often masked)
    nps_sp: string | null,               // NPS service provider / CRA, e.g. "PROT"
    value: decimal,                      // reported NPS portfolio value
    schemes: {
      scheme: string, fund_manager: string | null,
      tier: string | null,               // "I" | "II"
      asset_class: string | null,        // "E" | "C" | "G" | "A"
      units: decimal, nav: decimal, value: decimal,
    }[],
  } | null,

Adds NPSScheme/NPSAccount to NSDLCASData.nps; resolves the NPS holding
statement by order + units*nav. CDSL only; transactions out of scope.
@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.38843% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.97%. Comparing base (b5273fd) to head (dd0ad0f).

Files with missing lines Patch % Lines
casparser/parsers/cdsl.py 94.85% 5 Missing ⚠️
casparser/types.py 87.50% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #143      +/-   ##
==========================================
- Coverage   95.04%   94.97%   -0.06%     
==========================================
  Files          19       19              
  Lines        2858     2979     +121     
==========================================
+ Hits         2716     2829     +113     
- Misses        142      150       +8     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codereverser

Copy link
Copy Markdown
Owner Author

@mvineetmenon I've pushed a first draft of CDSL NPS support in this branch (feat/nps-cdsl). Can you please test and provide feedback?

If you have uv installed, you could test it via

uvx --from git+https://github.com/codereverser/casparser@feat/nps-cdsl casparser your_cdsl.pdf

# OR

uvx --from git+https://github.com/codereverser/casparser@feat/nps-cdsl casparser your_cdsl.pdf -o /tmp/cdsl_nps.json

Can you please confirm if the numbers match your statement?

@mvineetmenon

Copy link
Copy Markdown
Contributor

@codereverser Congratuations and thanks for implementing this feature.
The numbers are getting parsed correct. I checked this branch with three CASes. But in the latest MAY2026 CAS there was a problem with the fund name.

image Screenshot 2026-07-06 123732

@mvineetmenon

Copy link
Copy Markdown
Contributor

Yes, the issue is fixed. Everything is getting parsed correctly.

Thanks @codereverser

@codereverser

Copy link
Copy Markdown
Owner Author

Many thanks for testing. Merging this.

NPS is CDSL holdings only now. Transaction support and NSDL NPS would be done separately.

@codereverser codereverser merged commit ede19d2 into main Jul 6, 2026
4 checks passed
@codereverser codereverser deleted the feat/nps-cdsl branch July 6, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants