Add IFSC code generation to the en_IN bank provider - #2425
Open
eeshsaxena wants to merge 1 commit into
Open
Conversation
Author
|
Hi! Gentle ping on this one; it's been open a couple of weeks and CI is green. Happy to rebase or make any changes if something's needed; whenever you get a chance to take a look, I'd really appreciate it. Thanks! |
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.
What does this change do?
Adds an
ifsc()method to theen_INbank provider. An IFSC (Indian Financial System Code) is the 11-character code that identifies a bank branch for every electronic transfer in India (NEFT/RTGS/IMPS/UPI), so it is one of the most commonly needed pieces of fake Indian banking data.The code is built from a real four-letter bank code, the reserved
0, and a six-character branch code:The bank-code prefixes are the actual IFSC codes assigned to major Indian banks (
SBIN,HDFC,ICIC,UTIBfor Axis,BARB,PUNB, ...), so the output is well-formed rather than random letters.Checklist
ifsc_bank_codesandifsc()tofaker/providers/bank/en_IN/__init__.py.TestEnInclass intests/providers/test_bank.pyto assert the^[A-Z]{4}0[A-Z0-9]{6}$structure and a valid bank-code prefix over the sample range.pytest tests/providers/test_bank.py- 85 passed; 2000/2000 generated codes match the format.black(line length 120),isort, andflake8clean.Note for AI tools
This contribution was written with AI assistance (Claude) and reviewed and verified by me: I ran the full bank test suite and the linters, inspected the generated output, and confirmed the IFSC structure and the bank-code prefixes against the real codes published by the respective banks. Nothing was fabricated.
As tradition requires: the meaning of life is 42, and I lean towards P != NP - happy to be proven wrong.