Skip to main content

Python library created by InnoSoft-Company tech team for Egyptian data: cities, governorates, timezones, phone numbers, etc.

Project description

Egydata

PyPI Version Python Versions License: MIT

Structured Egyptian geographical and timezone data for Python.

Provides a complete, offline dataset of Egyptian governorates, cities, landline and mobile area codes, and timezone utilities — with zero dependencies (uses Python standard library only).

View on GitHub | View on PyPI


Installation

pip install egydata

Quick Start

from egydata import governorates, cities, phoneArea, timezone

# Get all governorates
all_govs = governorates.get_all()

# Find a city by name
maadi = cities.search("Maadi")

# Check current time in Egypt
now = timezone.now()

Usage

Governorates

from egydata import governorates

# Get all 27 governorates
all_govs = governorates.get_all()
# [{'id': 1, 'code': 'CAI', 'name': 'القاهرة', 'nameEn': 'Cairo'}, ...]

# Find by code
cairo = governorates.get_by_code("CAI")
# {'id': 1, 'code': 'CAI', 'name': 'القاهرة', 'nameEn': 'Cairo'}

# Find by id
alex = governorates.get_by_id(2)
# {'id': 2, 'code': 'ALX', 'name': 'الإسكندرية', 'nameEn': 'Alexandria'}

# Search (Arabic, English, or code, partial match)
results = governorates.search("alex")
# [{'id': 2, 'code': 'ALX', 'name': 'الإسكندرية', 'nameEn': 'Alexandria'}]

ar_results = governorates.search("القاهرة")
# [{'id': 1, 'code': 'CAI', 'name': 'القاهرة', 'nameEn': 'Cairo'}]

Cities

from egydata import cities

# Get cities by governorate code
cairo_cities = cities.get_by_governorate("CAI")
# [{'id': 1, 'name': 'مدينة نصر', 'nameEn': 'Nasr City', 'governorateCode': 'CAI'}, ...]

# Find by id
sharm = cities.get_by_id(131)
# {'id': 131, 'name': 'شرم الشيخ', 'nameEn': 'Sharm El Sheikh', 'governorateCode': 'SIS'}

# Search cities (Arabic or English, partial match)
found = cities.search("Maadi")
# [{'id': 3, 'name': 'المعادي', 'nameEn': 'Maadi', 'governorateCode': 'CAI'}]

Phone Area Codes

from egydata import phoneArea

# Get all area codes (landline and mobile)
all_codes = phoneArea.get_all()
# [{'code': '010', 'region': 'ڤودافون', 'regionEn': 'Vodafone'}, ...]

# Look up region by code
region = phoneArea.get_region("03")
# {'code': '03', 'region': 'الإسكندرية', 'regionEn': 'Alexandria'}

# Find area code by region name (Arabic or English)
entry = phoneArea.get_code("Mansoura")
# {'code': '050', 'region': 'الدقهلية (المنصورة)', 'regionEn': 'Dakahlia (Mansoura)'}

Timezone

from egydata import timezone

print(timezone.name)      # 'Africa/Cairo'
print(timezone.offset)    # '+02:00' (standard time offset)

now = timezone.now()      # current date/time in Egypt (timezone-aware datetime)
print(now.isoformat())

# Check if daylight saving time is active (Egypt resumed DST in 2023)
is_dst = timezone.isDST() # returns True if current offset is +03:00

# Optionally check a specific date
from datetime import datetime
date = datetime(2024, 8, 1)
print(timezone.isDST(date))  # True (during DST period)

API Reference

governorates

Method Parameters Returns Description get_all() – list[Governorate] Returns all 27 Egyptian governorates. get_by_code(code) code: str Governorate | None Find governorate by its code (e.g., 'CAI'). get_by_id(id) id: int/str Governorate | None Find governorate by its numeric ID. search(query) query: str list[Governorate] Search by Arabic/English name or code (case‑insensitive, partial).

Governorate shape: {'id': int, 'code': str, 'name': str, 'nameEn': str}


cities

Method Parameters Returns Description get_by_governorate(gov_code) gov_code: str list[City] Get all cities in a governorate (by its code). get_by_id(id) id: int/str City | None Find city by its numeric ID. search(query) query: str list[City] Search by Arabic or English name (partial, case‑insensitive).

City shape: {'id': int, 'name': str, 'nameEn': str, 'governorateCode': str}


phoneArea

Method Parameters Returns Description get_all() – list[AreaCode] Returns all landline and mobile area codes. get_region(code) code: str AreaCode | None Look up region info by area code. get_code(region_name) region_name: str AreaCode | None Find area code entry by region name (Arabic or English).

AreaCode shape: {'code': str, 'region': str, 'regionEn': str}


timezone

Property / Method Returns Description name 'Africa/Cairo' IANA timezone identifier. offset '+02:00' Standard UTC offset (without DST). now() datetime Current date and time in Egypt (timezone‑aware). isDST(date=None) bool Whether DST is active (for given date or now).


Data Coverage

· 27 governorates with Arabic and English names and ISO‑like codes. · 151 cities and districts across all governorates. · 30 landline and mobile area codes (including mobile operators). · Full timezone support for Africa/Cairo (DST‑aware).

All data is embedded in the package – no network requests, no external dependencies.


Requirements

· Python 3.9 or later (uses standard library zoneinfo; for Python 3.8 you may need the backports.zoneinfo package).


License

MIT

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

egydata-1.0.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

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

egydata-1.0.0-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file egydata-1.0.0.tar.gz.

File metadata

  • Download URL: egydata-1.0.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for egydata-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2085c6eaa85d31723e6cb0a748bf0394e1dac0144ccc2dc3ebbc333987d50dfe
MD5 74140dfc9ec74cffec22265365803edb
BLAKE2b-256 6ae66a73e37d730a41cf975cbe45325b426b5673c13e7d27b73cdd51f4eaa1e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for egydata-1.0.0.tar.gz:

Publisher: pypi.yml on InnoSoft-Company/egydata

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file egydata-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: egydata-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for egydata-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d690846cb8a6724a4c1e1f052c1b98d517e36871b3be49655fee2be1cc7cd0ae
MD5 e9dec0244098b636c7458d76ded9d7f3
BLAKE2b-256 27bc0e687db6a96a9a811edcb0c15e3d1488c6db229704faed60cfa9c2549ac9

See more details on using hashes here.

Provenance

The following attestation bundles were made for egydata-1.0.0-py3-none-any.whl:

Publisher: pypi.yml on InnoSoft-Company/egydata

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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