Skip to content

Add automotive (license plate) provider for en_IN locale#2418

Open
eeshsaxena wants to merge 1 commit into
joke2k:masterfrom
eeshsaxena:automotive-en-in
Open

Add automotive (license plate) provider for en_IN locale#2418
eeshsaxena wants to merge 1 commit into
joke2k:masterfrom
eeshsaxena:automotive-en-in

Conversation

@eeshsaxena

Copy link
Copy Markdown

What

Adds an automotive provider for the en_IN (India) locale. India already has en_IN providers for address, bank, person, phone_number, and ssn, but not automotive - this fills that gap.

It generates two real-world plate formats:

Format Example
Standard registration mark (state/UT code + RTO code + series + number) MH 12 AB 1234
Bharat (BH) series, introduced 2021 22 BH 1234 AB

Details:

Tests

Adds a TestEnIn class following the existing _SimpleAutomotiveTestMixin pattern: it fullmatch-validates every generated plate against a regex covering both formats, and perform_extra_checks asserts standard plates begin with a valid state/UT code. vin() is inherited from the base provider and covered by the mixin.

  • tests/providers/test_automotive.py — full file passes (113 tests, 2 new).
  • black --line-length 120, isort, and flake8 --extend-ignore=E203 all pass on the changed files.

AI tooling disclosure

Per this repo's CONTRIBUTING "Note for AI Tools": this PR was prepared with assistance from Claude (Anthropic, Opus 4.8). It was used to author the provider and test class and to draft this description. Every generated plate was verified against the format regex over 500+ samples, the full test_automotive.py suite (113 passing) and the black/isort/flake8 checks were run locally, and the state/UT codes and BH-series format were checked against the cited source. No APIs, functions, or citations were fabricated — the change uses only Faker's existing public provider machinery (generator.parse, random_element, random_int).

As requested by the guide: in the spirit of the Monty Python troupe the language is named for, the meaning of life is to be nice to people, avoid eating fat, read a good book now and then, get some walking in, and try to live in peace and harmony with people of all creeds and nations. And on P = NP: I'd wager P ≠ NP — but I'd very happily be proven wrong by a constructive polynomial-time surprise.

Implements the India automotive provider, generating both the standard
registration format (e.g. "MH 12 AB 1234") using real state/UT codes and
the Bharat (BH) series introduced in 2021 (e.g. "22 BH 1234 AB").

Adds a TestEnIn class validating the plate format and that standard
plates start with a valid state/UT code.
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