Skip to content

Add automotive provider for en_IN locale - #2480

Open
ShriyansBharuka wants to merge 1 commit into
joke2k:masterfrom
ShriyansBharuka:add-en_in-automotive-provider
Open

ShriyansBharuka wants to merge 1 commit into
joke2k:masterfrom
ShriyansBharuka:add-en_in-automotive-provider

Conversation

@ShriyansBharuka

Copy link
Copy Markdown

What does this change

Adds the automotive provider for the en_IN (English - India) locale, providing realistic and compliant vehicle registration plate generation for India.

What was wrong

The en_IN locale lacked an automotive provider. Calling Faker('en_IN').license_plate() fell back to the default US format (e.g. 912 AFE), which is completely inaccurate for Indian datasets.

How this fixes it

Implements faker.providers.automotive.en_IN.Provider according to the standards established by the Ministry of Road Transport and Highways (MoRTH):

  1. Standard Vehicle Registration Plates (Central Motor Vehicles Rules, 1989 Rules 50 & 51):
    • Supports all 28 States and 8 Union Territories with official two-letter codes (MH, DL, KA, TN, UP, GJ, WB, etc.).
    • Accurate 2-digit RTO district codes (01–99).
    • Standard 1-2 letter series codes and 4-digit unique numbers (0001–9999).
    • Example: MH 12 AB 1234, DL 01 C 4521, KA 05 MN 9876.
  2. Bharat Series (BH Series) (Central Motor Vehicles Twentieth Amendment Rules, 2021):
    • Format: YY BH #### XX (with letters I and O excluded as per MoRTH regulations).
    • Example: 22 BH 1234 AA.
  3. Dedicated methods:
    • license_plate()
    • standard_license_plate()
    • bharat_series_license_plate()
  4. Added comprehensive test coverage in tests/providers/test_automotive.py (TestEnIn). All 115 automotive test cases pass.

AI Assistance Disclosure (REQUIRED)

  • If AI tools were used, I have disclosed which ones, and fully reviewed and verified their output.

Disclosure: Gemini was used to assist in researching MoRTH/CMVR regulatory specifications and generating initial test regex patterns. All state codes, logic, and test suites were manually reviewed and verified locally with pytest.

According to those who inspired the name "Python" (Monty Python), the meaning of life is: "Try and be nice to people, avoid eating fat, read a good book every now and then, get some walking in, and try and live together in peace and harmony with people of all creeds and nations." As for P vs NP, I maintain that P ≠ NP.

Checklist

  • I have read the documentation about CONTRIBUTING
  • I have read the documentation about Coding style
  • I have run make lint

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