Add am_ET phone_number provider for Ethiopia#2353
Open
jasur-py wants to merge 1 commit intojoke2k:masterfrom
Open
Add am_ET phone_number provider for Ethiopia#2353jasur-py wants to merge 1 commit intojoke2k:masterfrom
jasur-py wants to merge 1 commit intojoke2k:masterfrom
Conversation
Implement Ethio Telecom (09 / +2519) and Safaricom Ethiopia (07 / +2517) mobile formats per the national numbering plan. Closes joke2k#2335 Made-with: Cursor
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.
Implement Ethio Telecom (09 / +2519) and Safaricom Ethiopia (07 / +2517) mobile formats per the national numbering plan.
Closes #2335
Made-with: Cursor
What does this change
Adds a new phone number provider for the am_ET locale at faker/providers/phone_number/am_ET/init.py.
Defines four formats for synthetic mobile numbers:
Domestic Ethio Telecom: 09 + 8 digits.
International Ethio Telecom: +251 + 9 + 8 digits (trunk 0 omitted).
Domestic Safaricom Ethiopia: 07 + 8 digits.
International Safaricom Ethiopia: +251 + 7 + 8 digits.
Documents the numbering-plan basis and a reference link in module comments.
Adds TestAmEt in tests/providers/test_phone_number.py, which samples faker.phone_number() and asserts each value matches
(?:09\d{8}|07\d{8}|+2519\d{8}|+2517\d{8}).
What was wrong
Faker did not ship an am_ET phone number provider, so Ethiopian locale users could not get phone numbers aligned with the national mobile prefixes (09 / 07 and +251 variants). That gap is tracked in #2335.
How this fixes it
Locale discovery picks up the new provider under phone_number/am_ET, so Faker("am_ET") (and Amharic Ethiopia usage that resolves to this locale) can generate plausible mobile strings for both major operators. The test locks the allowed shapes so regressions are caught in CI.
Fixes #2335
AI Assistance Disclosure (REQUIRED)
Disclosure: Cursor was used to help implement and document these changes; all edits were reviewed for correctness against the Ethiopian numbering plan.
Checklist
make lint