Add Indian Financial System Code (IFSC) bank branch code validation - #511
Open
yashbudhia wants to merge 1 commit into
Open
Add Indian Financial System Code (IFSC) bank branch code validation#511yashbudhia wants to merge 1 commit into
yashbudhia wants to merge 1 commit into
Conversation
The IFSC is the 11 character code the Reserve Bank of India assigns to every bank branch on NEFT, RTGS and IMPS, and is needed for every domestic electronic transfer and for routing UPI payments. It is a 4 letter bank code, a reserved fifth character that is always 0, and a 6 character alphanumeric branch code, with no check digit. The module provides compact(), validate(), is_valid() and info() (bank and branch code). The doctests cover 60 real codes from the openly maintained Razorpay IFSC dataset, which is derived from the RBI's published list, and were chosen to span many banks and both numeric and alphanumeric branch codes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011ZJQzxtgWvkWobxsDcuLoW
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds
stdnum.in_.ifscfor the Indian Financial System Code, the bank branch identifier the Reserve Bank of India assigns to every branch that participates in NEFT, RTGS and IMPS. It is required for every domestic electronic funds transfer in India and is also used to route UPI payments, so it shows up in practically every Indian payments, lending and KYC system. Thein_package already covers PAN, GSTIN, Aadhaar, EPIC and VID; IFSC is the missing banking one.Format
0, then a 6 character branch code.HDFC0CABBLM).stdnum.bic.Sources
What is included
compact(),validate(),is_valid()andinfo()(returnsbank_codeandbranch_code), following the conventions of the existingin_modules.tests/test_in_ifsc.doctestwith 60 real codes taken from the Razorpay dataset, chosen to span many different banks and both numeric and alphanumeric branch codes, plus corner cases for length, the reserved fifth character, bad characters and normalisation.0, soInvalidComponentfor a non-zero fifth character is justified.Per CONTRIBUTING I have not touched NEWS, README or docs.
pytest,flake8andscripts/check_headers.pypass on the new files;mypyreports only the pre-existingzeepimport notes thatpan.pyalso reports.