Skip to content

Generate Egyptian realistic datasets in Python for testing & simulating the customer base.

License

Notifications You must be signed in to change notification settings

mahmoudahmedd/Egyptian-Data-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

MIT License LinkedIn

Egyptian Data Generator

Generate Egyptian realistic datasets in Python for testing & simulating the customer base.


Table of Contents

About The Project

Suppose you need to generate Egyptian realistic datasets with 100,000 rows to simulate the customer base so it will be complicated because the lack of Egyptian data... Therefore this tool will help you.

(All data are uniform distributed & You can make it related to each other e.g governorat and national id)

The specification:

  • address
    • governorat ("Giza")
    • zip_code (12551)
    • address ("54 El cooperation / Urban eastern m .Shortly")
    • post_office ("Urban East")
    • latitude (30.0130557)
    • longitude (31.2088526)
  • name
    • first_name (Mahmoud)
    • last_name (Ahmed)
    • full_name (Mahmoud Ahmed)
    • user_name (mahmoud_ahmed_0)
  • NationalID
    • generate (2541119632960)
  • PhoneNumber
    • dialing_code (+20)
    • provider (Vodafone)
    • phone_number (01014856695)
    • intl_phone_number (+201014856695)
  • date
    • between (1997-12-8)
    • recent (1997-12-8)
  • dateTime
    • between (1997-12-8 11:03)
    • recent (1997-12-8 11:03)
    • recentUnixTime (1606251876)
  • finance
    • visa13CreditCardNumber
    • visa16CreditCardNumber
    • mastercardCreditCardNumber
  • helpers
    • intBetween
    • oneChoice
    • replaceSymbolWithNumber

Built With

Usage

from egyptian_data_generator import *
import pymysql

egyDataGen = EgyptianDataGenerator()

db = pymysql.connect("localhost", "username", "password", "database_name")
cursor = db.cursor()

for i in range(1, 100000):
    phoneNumber = egyDataGen.phoneNumber.generate()["intl_phone_number"]
    name = egyDataGen.name.generate()
    firstName = name["first_name"]
    lastName = name["last_name"]
    gender = name["gender"]
    dateOfBirth = egyDataGen.date.between()

    sql = "INSERT INTO users(phone_number, first_name, last_name, gender, date_of_birth, user_type) \ 
    VALUES ('%s', '%s', '%s', '%s', '%s','%d' )" % \
   (phoneNumber, firstName, lastName, gender, dateOfBirth, 1)
    
    try:
        cursor.execute(sql)
        db.commit()
    except:
        db.rollback()

db.close()

Contributing

Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Mahmoud Ahmed - Twitter @1243Mahmoud - mahmoud_ahmed@stud.fci-cu.edu.eg

Project Link: https://github.com/mahmoudahmedd/Egyptian-Data-Generator

About

Generate Egyptian realistic datasets in Python for testing & simulating the customer base.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages