Egyptian ID Validator is a production-ready Python package for validating and parsing Egyptian national ID numbers.
It enforces the official structural rules defined by the Egyptian Ministry of Interior, including a verified but undisclosed checksum mechanism.
ℹ️ This package is part of a broader multi-language validation system.
For other implementations (e.g., Java, NPM), see the Egyptian-ID-Validator mother repository.
- ✅ Format Validation – Ensures the ID is 14 digits and correctly structured.
- ✅ Checksum Validation – Verifies integrity using an official checksum method.
- ✅ Component Extraction – Parses the ID into:
- Year, Month, and Day of Birth
- Governorate Name and Code
- Gender (Male/Female)
Install directly from PyPI:
pip install egyptian-id-validatorSupports Python >3.8.
from egyptian_id_validator.validation import validate_egyptian_id
id_number = "20001012345678" # Replace with the ID you want to validate
result = validate_egyptian_id(id_number)
if result:
print("Valid ID:")
for key, value in result.items():
print(f"{key}: {value}")
else:
print("Invalid ID.")This package is stable and currently in production use. All validation logic adheres to official specifications.
Contributions are welcome — especially for:
- Bug reports
- Feature suggestions
- Language porting alignment
Please use Issues and Pull Requests.
This project is licensed under a custom MIT License with Limited Commercial Use Restrictions.
You are free to use, modify, and integrate the package — including in commercial projects — as long as:
- You provide proper attribution
- You do not sell, sublicense, or rely on this package as the core functionality or main value of a monetized product or service without prior permission
See the LICENSE.md file for full terms.
Mohamed A. Abdallah