Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Sanitize, validate and format phone numbers into E.164 valid phone numbers.
Sanitize, validate and format phone numbers into E.164 valid phone numbers.
Google's libphonenumber on steroids. Tries all sorts of crazy combinations in an attempt to create a valid phone number. Useful for those of us who have to deal with poorly sanitized data.
$ pip install py-phone-number-fmt
from phonenumberfmt import format_phone_number
# implied phone region is the country of which to
# use the dialing prefix in case the number appears
# to be local
result = format_phone_number('778\173 0.92', implied_phone_region='RO')
assert result == '+40778173092'
# implied phone region is the country of which to
# use the dialing prefix in case the number appears
# to be local
result = format_phone_number_list('+40773818041 / +97172273000', implied_phone_region='RO')
assert result == ['+40778173092', '+97172273000']
The resulting phone number will be formatted according to the E.164 standard. Want to change the output format? Pass the third, optional parameter fmt
with a valid member of phonenumbers.NumberFormat
:
from phonenumbers import NumberFormat
result = format_phone_number(
'778\173 0.92',
implied_phone_region='RO',
fmt=NumberFormat.INTERNATIONAL, # default is NumberFormat.E164
)
FAQs
Sanitize, validate and format phone numbers into E.164 valid phone numbers.
We found that py-phone-number-fmt demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.