Skip to content
/ niafaker Public

NiaFaker is a Python package that generates fake data localized for African regions

License

Notifications You must be signed in to change notification settings

owgee/niafaker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NiaFaker

Tests PyPI version License: MIT

Fake data generator localized for African regions. Names, phone numbers, mobile money, national IDs, and more — culturally accurate for 10 African economies.

Install

pip install niafaker

Usage

from niafaker import NiaFaker

fake = NiaFaker("tz")  # Tanzania

fake.name()            # "Baraka Kimaro"
fake.name(gender="f")  # "Amina Mwakasege"
fake.phone()           # "+255754832109"
fake.mobile_money()    # {"provider": "M-Pesa", "number": "+255754832109"}
fake.national_id()     # "19901234-12345-00001-01"
fake.company()         # "Bakhresa Holdings"
fake.amount()          # "TSh 425,000"
fake.address()         # "1234 Samora Avenue, Dodoma, Dodoma"

For reproducible output (useful in tests):

fake = NiaFaker("ke", seed=42)
fake.name()  # same result every time

Supported Countries

tz Tanzania · ke Kenya · ng Nigeria · za South Africa · gh Ghana · ug Uganda · rw Rwanda · et Ethiopia · eg Egypt · ma Morocco

NiaFaker.locales()  # {'tz': 'Tanzania', 'ke': 'Kenya', ...}

What You Can Generate

Personname(), first_name(), last_name(), email() Phonephone(), phone(carrier="Safaricom") Addresscity(), region(), address(), country() Companycompany(), registration_number() Mobile Moneymobile_money(), transaction_id() National IDnational_id() Currencyamount()

Contributing

See CONTRIBUTING.md. Adding a new country is just 7 JSON files and one line in the config.

License

MIT — Owden Godson

About

NiaFaker is a Python package that generates fake data localized for African regions

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages