Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: create simple_cellphone_number format #1847

Closed
dlwrnc opened this issue Apr 18, 2023 · 0 comments
Closed

Suggestion: create simple_cellphone_number format #1847

dlwrnc opened this issue Apr 18, 2023 · 0 comments

Comments

@dlwrnc
Copy link
Contributor

dlwrnc commented Apr 18, 2023

  • Faker version: faker 18.4.0
  • OS: mac os monterey

Ideal behavior

Ideal behavior would be a situation where it's possible to create only phone numbers of format ##########. I've found a few forms that are built to only expect a "basic" ten-digit phone number.

Actual behavior

Actual behavior is that there's no way to define the ideal phone number format so narrowly in the existing code.

My suggested change is to the en_US file, adding a format type like:

simple_format = ('##########', '###-###-####')

and then a

    def simple_cellphone_number(self) -> str:
        pattern: str = self.random_element(self.simple_format)
        return self.numerify(self.generator.parse(pattern))

happy to make this change myself. :)

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

No branches or pull requests

1 participant