Skip to main content

Fake data generator for Pakistani names, CNICs, phone numbers, and addresses.

Project description

🇵🇰 faker-pk

faker-pk is a lightweight Python library that generates fake Pakistani data — including names, CNICs, phone numbers, cities, and addresses — for testing, demos, and development purposes.

It’s designed for developers who want realistic-looking Pakistani data in their applications or ML datasets.


🧩 Installation

Install directly from PyPI:

pip install faker-pk

Or upgrade to the latest version:

pip install --upgrade faker-pk

⚡ Quick Start

from faker_pk import FakerPK

fake = FakerPK()

print(fake.male_name())       # "Bilal Khan"
print(fake.female_name())     # "Ayesha Malik"
print(fake.cnic())            # "37405-7654321-9"
print(fake.phone_number())    # "+923001234567"
print(fake.city())            # "Lahore"
print(fake.province())        # "Punjab"
print(fake.full_address())    # "House No. 45, Street No. 6, Karachi, Sindh, 75000"
print(fake.company_name())    # "Tech Solutions"

🔁 Generate Multiple Entries

You can generate a list of fake entries by passing an integer count:

fake.male_name(5)
# ['Ali Khan', 'Usman Raza', 'Zain Qureshi', 'Ahmed Farooq', 'Sami Shah']

fake.city(3)
# ['Lahore', 'Islamabad', 'Multan']

🧠 Features

  • Realistic Pakistani male and female names
  • Valid CNIC format (xxxxx-xxxxxxx-x)
  • Pakistani-style phone numbers (+92xxxxxxxxxx)
  • Cities and provinces from real data
  • Randomized company and address generation
  • Easy to extend for your own data sources

🧩 API Reference

Function Description Example Output
male_name(count=1) Generates one or more male names ['Ali Khan']
female_name(count=1) Generates one or more female names ['Ayesha Malik']
cnic(count=1) Generates valid CNIC numbers ['37405-1234567-8']
phone_number(count=1) Generates Pakistani phone numbers ['+923001234567']
city(count=1) Returns cities from Pakistan ['Karachi']
province(count=1) Returns Pakistani provinces ['Sindh']
full_address(count=1) Returns complete fake addresses ['House No. 23, Street No. 8, Lahore, Punjab, 54000']
company_name(count=1) Returns random company names ['TechNova Pvt Ltd']

🧪 Example Script

from faker_pk import FakerPK

fake = FakerPK()  

for _ in range(3):
    print({
        "Name": fake.male_name(),
        "CNIC": fake.cnic(),
        "Phone": fake.phone_number(),
        "Address": fake.full_address(),
        "Company": fake.company_name()
    })

Output:

{'Name': 'Ali Raza', 'CNIC': '35201-6543210-7', 'Phone': '+923125678901', 'Address': 'House No. 12, Street No. 3, Islamabad, Islamabad, 44000', 'Company': 'Techworks'}

🛠️ Development

Clone the repository and install locally:

git clone https://github.com/Khubaib8281/faker-pk.git
cd faker-pk
pip install -e .

🚀 Contributing

Contributions are welcome!
If you’d like to add more realistic datasets (Pakistani districts, universities, etc.), submit a pull request.


🧾 License

This project is licensed under the MIT License.


👤 Author

Muhammad Khubaib Ahmad
📧 khubaib0.1ai@gmail.com
🌐 GitHub: Khubaib8281


⭐ Support

If you find this library useful, consider giving it a star on GitHub to support development!

👉 https://github.com/Khubaib8281/faker-pk

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

faker_pk-0.1.6.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

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

faker_pk-0.1.6-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file faker_pk-0.1.6.tar.gz.

File metadata

  • Download URL: faker_pk-0.1.6.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for faker_pk-0.1.6.tar.gz
Algorithm Hash digest
SHA256 db8592cc4e265e1ba38d9ba238ebb08fd2af9d6c1f72e359543105011f5173d0
MD5 0fbf0bf0add79bdb3230e7d12ac0c0f0
BLAKE2b-256 4ade632157fec841b38f524705b32c0e2e2d5c875fe66392f21e8db92d00579f

See more details on using hashes here.

File details

Details for the file faker_pk-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: faker_pk-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for faker_pk-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e75a1a22a323e9af4e0b2a5dfe399f3c75f2f71da57afa4f0fcba8f1ca997e35
MD5 ca9acb2494f04b7c54f3955c0ffc3ebb
BLAKE2b-256 023a739411df395c068a5aa921722be4a6567286578a8e61cbfe766d5bdf5b7a

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