![38% of CISOs Fear They’re Not Moving Fast Enough on AI](https://cdn.sanity.io/images/cgdhsj6q/production/faa0bc28df98f791e11263f8239b34207f84b86f-1024x1024.webp?w=400&fit=max&auto=format)
Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
python-algerian-mobile-phone-number
Advanced tools
This package provides several methods to deal with Algerian phone numbers.
The aim of this package is to create a python community in Algeria and provide all possible libraries to make python frameworks and projects such as Django or Flask adapted to Algerian market and easy to use.
Inspired by the PHP Package authored by Mohamed Cherif Bouchelaghem.
Use the package manager pip to install Python Algerian mobile phone number package.
pip install python-algerian-mobile-phone-number
Create an instance of the class AlgerianMobilePhoneNumber and pass the phone number value as an attribute
from python_algerian_mobile_phone_number import AlgerianMobilePhoneNumber
phoneNumber = AlgerianMobilePhoneNumber('0770000000')
Or:
phoneNumber = AlgerianMobilePhoneNumber('07 70 00 00 00')
Or:
phoneNumber = AlgerianMobilePhoneNumber('07-70-00-00-00')
NOTE: For now only space and hyphens "-" separated numbers are accepted.
NOTE: International phone indicative such 00213 or +213 are accepted.
To get the string representation of the instance use the built in function __str__:
phoneNumber.__str__() #'0770000000'
To compare two phone numbers:
other = AlgerianMobilePhoneNumber('0770000000')
phoneNumber.equalsTo(other) #True
To check the mobile phone number provider including Mobilis, Djezzy and Ooredoo
phoneNumber = AlgerianMobilePhoneNumber('0770000000')
phoneNumber.isMobilis() #False
phoneNumber.isDjezzy() #True
phoneNumber.isOoredoo() #False
To change the phone number of an instance:
phoneNumber = AlgerianMobilePhoneNumber('0770000000')
phoneNumber.changeNumber('0798000000') #'0798000000'
The method takes one parameter named prefix -- values only '00' and '+'
phoneNumber = AlgerianMobilePhoneNumber('0770000000')
phoneNumber.convertToInternational() #'00213770000000'
phoneNumber.convertToInternational('00') #'00213770000000'
phoneNumber.convertToInternational('+') #'+213770000000'
The method convert the internaltionl number to local one. Accepts both '00213' and '+213'
phoneNumber = AlgerianMobilePhoneNumber('00213770000000')
phoneNumber.convertToLocal() #'0770000000'
NOTE: convertToInternational and convertToLocal does not change the number instance so you can assign it to a variable. If you want to change the class instance use changeNumber instead to avoid mistakes.
Contributions are welcome to give the best of this package.
$ git clone git@github.com:mohamine18/python_algerian_mobile_phone_number.git
$ pip install pytest
$ pytest test.py
FAQs
Algerian mobile phone number package
We found that python-algerian-mobile-phone-number 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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.