A flexible and extensible phone number validation package for GCC countries and Egypt.
Project description
Django_Phone_Number_Field_GCC 📞
A flexible and extensible phone number validation package for GCC countries and Egypt.
Overview
Django_Phone_Number_Field_GCC is a Python package designed to validate phone numbers for GCC countries (Saudi Arabia, UAE, Qatar, Kuwait, Oman, Bahrain) and Egypt. It provides a custom Django field that can be easily integrated into your Django models, along with flexible validation options.
Key Features:
- Country-Specific Validation: Validate phone numbers based on the country code (e.g.,
EGfor Egypt,SAfor Saudi Arabia). - Flexible Field Options: Supports Django field arguments like
max_length,blank, andnull. - Allow All GCC Countries: Optionally validate phone numbers for all GCC countries at once.
- Extensible: Easily add new countries or validation rules.
Installation
Install the package via pip:
pip install phonevalidatorx
from django.db import models
from phonevalidatorGCC.fields import PhoneNumberField
class UserProfile(models.Model):
# Example: Accept phone numbers from all GCC countries
gcc_phone = PhoneNumberField(
allow_all_country=True,
max_length=15,
blank=True,
null=True,
help_text="Enter a phone number from any GCC country."
)
# Example: Accept only Egyptian phone numbers
egypt_phone = PhoneNumberField(
country_code='EG', # Changeable for any of these ['EG', 'SA', 'AE', 'QA', 'KW', 'OM', 'BH']
max_length=11,
blank=False,
null=False,
help_text="Enter a valid Egyptian phone number."
)
def __str__(self):
return f'GCC Phone: {self.gcc_phone}, Egypt Phone: {self.egypt_phone}'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_gcc_phonenumbers-0.0.3.tar.gz.
File metadata
- Download URL: django_gcc_phonenumbers-0.0.3.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b11bf3cef6d5c38ff36f73a3034f226ad320ebba304c30b518e959d7ed8b3fb
|
|
| MD5 |
10a76c84c95d60f0b3727719a62c873c
|
|
| BLAKE2b-256 |
fff0886d76f92c09211c3b6c50b94a7c285eece5a3f7b7670e45a58a96969ef9
|
File details
Details for the file Django_GCC_PhoneNumbers-0.0.3-py3-none-any.whl.
File metadata
- Download URL: Django_GCC_PhoneNumbers-0.0.3-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45ae3d31216244131a77a8b4cef3608b1eb47591940c249d52f1fcb3cb3c615a
|
|
| MD5 |
4dd43c6e1092315026502cbacdae18b0
|
|
| BLAKE2b-256 |
d617a3c9a303a3957889f1467e0c505dadb2566dd4e928ad4f1ab809a56bf449
|