Skip to main content

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

Metadata

Release files for egyptian-id-validator 0.4.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for egyptian-id-validator 0.4.4
File Size Uploaded
egyptian_id_validator-0.4.4.tar.gz 6.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for egyptian-id-validator 0.4.4
File Interpreter ABI Platform
egyptian_id_validator-0.4.4-py3-none-any.whl Python 3 none any Details

Total release size: 12.9 kB

Release files / egyptian_id_validator-0.4.4.tar.gz

Download URL egyptian_id_validator-0.4.4.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
294685a455546f3158e0526ea352ed7a6ffeae27301b22ea2710e43c3e46cbfd
BLAKE2b-256 checksum
How to use checksums
050ed8eda432df269fb77c2c362870cfc32ed93d141c392a9daee6e420f04031
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.13

Release files / egyptian_id_validator-0.4.4-py3-none-any.whl

Download URL egyptian_id_validator-0.4.4-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d579c2abb2d6a9a3cca03b1971a9b43d0164f9e2739536713b5e5860488a05c0
BLAKE2b-256 checksum
How to use checksums
7a201ff13ee3aef2e07ac0dd3dfc36ac3a3e6509f14a5507301c5cfed5ecbf86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.13

Release history Release notifications | RSS feed

This release

0.4.4 This release

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page