Skip to content

Add IFSC code generation to the en_IN bank provider - #2425

Open
eeshsaxena wants to merge 1 commit into
joke2k:masterfrom
eeshsaxena:feat/en-in-ifsc
Open

Add IFSC code generation to the en_IN bank provider#2425
eeshsaxena wants to merge 1 commit into
joke2k:masterfrom
eeshsaxena:feat/en-in-ifsc

Conversation

@eeshsaxena

Copy link
Copy Markdown

What does this change do?

Adds an ifsc() method to the en_IN bank 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:

>>> fake = Faker("en_IN")
>>> fake.ifsc()
'SBIN0000123'
>>> fake.ifsc()
'UTIB0YEL16I'

The bank-code prefixes are the actual IFSC codes assigned to major Indian banks (SBIN, HDFC, ICIC, UTIB for Axis, BARB, PUNB, ...), so the output is well-formed rather than random letters.

Checklist

  • Added ifsc_bank_codes and ifsc() to faker/providers/bank/en_IN/__init__.py.
  • Extended the existing TestEnIn class in tests/providers/test_bank.py to assert the ^[A-Z]{4}0[A-Z0-9]{6}$ structure and a valid bank-code prefix over the sample range.
  • Verified: pytest tests/providers/test_bank.py - 85 passed; 2000/2000 generated codes match the format. black (line length 120), isort, and flake8 clean.

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.

@eeshsaxena eeshsaxena closed this Jul 16, 2026
@eeshsaxena eeshsaxena reopened this Jul 16, 2026
@eeshsaxena

Copy link
Copy Markdown
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!

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.

1 participant