Fake data generator for Pakistani names, CNICs, personal info, address info, job titles, IBAN, Bank names, cities, provinces, castes, sect, network providers, job aware salaries and companies info.
Project description
🇵🇰 faker-pk
\
faker-pk is a Python library that generates realistic Pakistani data for testing, demos, datasets, and development.
It includes names, CNICs, phone numbers, addresses, bank info, company details, jobs, salaries, and more.
It also provides full support as a Faker provider so you can integrate it directly into the Faker ecosystem.
It’s designed for developers who want realistic-looking Pakistani data in their applications or ML datasets.
Why Use faker-pk?
Developers working with Pakistani applications often struggle with:
- Generating realistic user data
- Testing CNIC and phone formats
- Filling databases with sample business information
- Creating synthetic datasets
- Running demos without exposing real personal data
faker-pk solves this by providing structured, validated, Pakistan-focused fake data.
📦 Installation
pip install faker-pk
Upgrade:
pip install --upgrade faker-pk
Quick Usage (FakerPK Class)
from faker_pk import FakerPK
fake = FakerPK()
print(fake.male_name())
print(fake.cnic())
print(fake.phone_number())
print(fake.full_address())
print(fake.company_name())
🧩 All Attributes & Functions
Below is the full API that faker-pk generates.
👤 Personal Information
| Function | Description | Example |
|---|---|---|
male_name(count=1) |
Pakistani male names | "Bilal Khan" |
female_name(count=1) |
Pakistani female names | "Ayesha Malik" |
cnic(count=1) |
Valid CNIC format xxxxx-xxxxxxx-x |
"35201-6543210-7" |
phone_number(count=1) |
Pakistani mobile format | +923041234567 |
sim_provider(count=1) |
Mobile network providers | "Jazz" |
caste(count=1) |
Castes used across Pakistan | "Ansari" |
sect(count=1) |
Religious sects | "Sunni" |
dob(count=1) |
Random date of birth | "1998-05-14" |
🏠 Address Information
| Function | Description | Example |
|---|---|---|
city(count=1) |
Cities in Pakistan | "Karachi" |
province(count=1) |
Pakistani provinces | "Punjab" |
full_address(count=1) |
Complete Pakistani address | "House No. 45, Street 10, Lahore, Punjab, 54000" |
🏢 Company & Business Information
| Function | Description | Example |
|---|---|---|
company_name(count=1) |
Random company names | "TechWorks Pvt Ltd" |
industry_name(count=1) |
Industries in Pakistan | "Telecommunications" |
bank_name(count=1) |
Pakistani banks | "HBL" |
iban(count=1) |
Pakistani IBAN format | "PK36HABB0000001234567890" |
salary(count=1, industry=industry) |
Salary estimates (industry-aware) | 95000 |
Valid
industryparameters that are considered:
- IT
- Finance
- Healthcare
- Education
- Marketing
- Government
- Engineering
- Retail
- Entrepreneur
- Consulting
💼 Job Information
| Function | Description | Example |
|---|---|---|
job_title(count=1) |
Random job titles | "Software Engineer" |
job_title_with_industry(count=1) |
Job title with industry | "Finance Analyst – Banking" |
🔁 Generating Multiple Items
fake = FakerPK()
fake.city(3)
# ['Lahore', 'Islamabad', 'Multan']
fake.male_name(5)
# ['Ali Khan', 'Usman Raza', 'Zain Qureshi', 'Ahmed Farooq', 'Sami Shah']
🔌 Faker Provider Integration
faker-pk fully integrates with the Faker library via FakerPKProvider.
➤ Add Provider to Faker
from faker import Faker
from faker_pk import FakerPKProvider
fake = Faker()
fake.add_provider(FakerPKProvider)
print(fake.pk_male_name())
print(fake.pk_cnic())
print(fake.pk_full_address())
➤ Provider Methods
| Provider Function | Description |
|---|---|
pk_male_name() |
Male name |
pk_female_name() |
Female name |
pk_cnic() |
CNIC |
pk_phone_number() |
Pakistani mobile number |
pk_sim_provider() |
Mobile network |
pk_caste() |
Caste |
pk_sect() |
Sect |
pk_dob() |
DOB |
pk_city() |
City |
pk_province() |
Province |
pk_full_address() |
Complete address |
pk_company_name() |
Company |
pk_industry_name() |
Industry |
pk_job_title() |
Industry-aware job title |
pk_job_title_with_industry() |
Combined title |
pk_salary(industry=industry) |
Salary range |
pk_bank_name() |
Bank |
pk_iban() |
IBAN |
🧩 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(),
"Salary": fake.salary(industry="Information Technology")
})
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
You can contribute by:
- Adding realistic datasets ( universities, etc.)
- Improving job industries and salaries
- Expanding address and bank coverage
- Adding validation utilities
Pull requests are welcome.
📄 License
MIT License.
👤 Author
Muhammad Khubaib Ahmad
📧 khubaib0.1ai@gmail.com
🌐 GitHub: Khubaib8281
🐍 PYPI: Khubaib_01
LinkedIn: https://www.linkedin.com/in/muhammad-khubaib-ahmad-
⭐ Support
If this project helps you, give it a star on GitHub!
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file faker_pk-0.1.9.tar.gz.
File metadata
- Download URL: faker_pk-0.1.9.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c95b1b0add72949654ff2333b0b35904f93555d1812022ec26ce4acdf4d96cc
|
|
| MD5 |
4bab07b32fe44ab0dc876b425065291f
|
|
| BLAKE2b-256 |
8c7c7704637f618f83401739e73b2bed2cc8470019a542126c9415a6f665e676
|
File details
Details for the file faker_pk-0.1.9-py3-none-any.whl.
File metadata
- Download URL: faker_pk-0.1.9-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a29b7e9de0a62a14fd484b599cfb4db1e5a2dbe533ed76e01c0f69ebfb57a35b
|
|
| MD5 |
c299db2a08ff372f8a53a791a951ee9b
|
|
| BLAKE2b-256 |
840419ea5c98b03d934a266ff0c75da5b32858cfd5b38a738ee12ca391f7efff
|