← All projects

py-dz-phone-number

by @01walid

29

Algerian phone numbers as a value object implementation in Python

About this project

Algerian phone numbers as a value object Inspired from the PHP implementation with some differences (see below). Algerian phone numbers as a value object implementation in Python. This can be used in your domain models or be integrated with your favorite framework. What is value object? In computer science, a value object is a small object that represents a simple entity whose equality is not based on identity: i.e. two value objects are equal when they have the same value, not necessarily being the same object. Read more on wikipedia. Installation: Usage: Equality Correctness Immutability The object can't be modified if you try to modify of its members, a TypeError will be raised: Understanding the regex 03 main parts of the full number are categorized into three groups: indicative (Country Code), Operator or Region (e.g. Ooredoo or Annaba), and the rest of the dial number. The regex uses Python's capturing group feature built in its regex engine. Where "Country Code", "Operator or Region" and the "Number" are put into numbered groups when matched. The regex also uses a conditional statemet in the form of (?(1)yes no) where (1) is the capturing group number.

From the project README on GitHub

Stars
29
Forks
1
License
MIT
Last push
16 Jun 2020

Add this badge to your README

Show that your project is listed on Made in Algeria.

Made in Algeria
[![Made in Algeria](https://www.madeinalgeria.dev/badge/py-dz-phone-number.svg)](https://www.madeinalgeria.dev/projects/py-dz-phone-number)

Related projects