Skip to main content

A Python package for validating Egyptian National IDs.

Project description

Egyptian ID Validator (Python)

GitHub tag PyPI version Python Versions Build Status CodeFactor Last Commit License


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.


🔍 Features

  • 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)

📦 Installation

Install directly from PyPI:

pip install egyptian-id-validator

Supports Python >3.8.


🚀 Quick Usage

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.")

📁 Project Status

This package is stable and currently in production use. All validation logic adheres to official specifications.


🤝 Contributing

Contributions are welcome — especially for:

  • Bug reports
  • Feature suggestions
  • Language porting alignment

Please use Issues and Pull Requests.


📄 License

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.


👤 Author

Mohamed A. Abdallah

GitHub | Email

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

egyptian_id_validator-0.4.4.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

egyptian_id_validator-0.4.4-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file egyptian_id_validator-0.4.4.tar.gz.

File metadata

  • Download URL: egyptian_id_validator-0.4.4.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for egyptian_id_validator-0.4.4.tar.gz
Algorithm Hash digest
SHA256 294685a455546f3158e0526ea352ed7a6ffeae27301b22ea2710e43c3e46cbfd
MD5 359031733d4607bf7fc7f409eccba546
BLAKE2b-256 050ed8eda432df269fb77c2c362870cfc32ed93d141c392a9daee6e420f04031

See more details on using hashes here.

File details

Details for the file egyptian_id_validator-0.4.4-py3-none-any.whl.

File metadata

File hashes

Hashes for egyptian_id_validator-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d579c2abb2d6a9a3cca03b1971a9b43d0164f9e2739536713b5e5860488a05c0
MD5 d48f42a78e1dfd48fdcb3b594a02be8e
BLAKE2b-256 7a201ff13ee3aef2e07ac0dd3dfc36ac3a3e6509f14a5507301c5cfed5ecbf86

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page