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

Get country code for international prefix #59

Closed
tspecht opened this issue Oct 8, 2015 · 1 comment
Closed

Get country code for international prefix #59

tspecht opened this issue Oct 8, 2015 · 1 comment
Labels

Comments

@tspecht
Copy link

tspecht commented Oct 8, 2015

If I would have an valid internal number like +49123456789 is there any way I could get the country code of the numbers country (which would be in this example "de" or "DE" because its +49)?

@daviddrysdale
Copy link
Owner

>>> import phonenumbers
>>> x = phonenumbers.parse('+49123456789', None)
>>> phonenumbers.region_code_for_number(x)
'DE'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants