Add automotive (license plate) provider for en_IN locale#2418
Open
eeshsaxena wants to merge 1 commit into
Open
Add automotive (license plate) provider for en_IN locale#2418eeshsaxena wants to merge 1 commit into
eeshsaxena wants to merge 1 commit into
Conversation
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.
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
Adds an
automotiveprovider for theen_IN(India) locale. India already hasen_INproviders for address, bank, person, phone_number, and ssn, but not automotive - this fills that gap.It generates two real-world plate formats:
MH 12 AB 123422 BH 1234 ABDetails:
IandOto avoid confusion with1and0, matching real-world practice.Tests
Adds a
TestEnInclass following the existing_SimpleAutomotiveTestMixinpattern: it fullmatch-validates every generated plate against a regex covering both formats, andperform_extra_checksasserts 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, andflake8 --extend-ignore=E203all 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.pysuite (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.