Skip to content

This script generates a specified number of random contacts in various formats, including VCF, XML, CFG, JSON, and CSV

License

Notifications You must be signed in to change notification settings

Rohijulislam/Random-Contact-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Random Contact Generator

This script generates a specified number of random contacts in various formats, including VCF, XML, CFG, JSON, and CSV. Each contact contains a first name, last name, email address, birthday, and a random number of phone numbers with corresponding labels. The script uses the Faker library to generate realistic contact data.

Dependencies

The script relies on the following Python packages:

Installation

  1. Make sure you have Python 3.x installed on your system. If not, you can download and install Python from the official website: Python Downloads.

  2. Clone this repository or download the script generate_contacts.py to your local machine.

  3. Install the required Python dependencies by running the following command in your terminal:

    pip install vobject faker

    If you have both Python 2 and Python 3 installed, and pip is associated with Python 2, use pip3 instead:

    pip3 install vobject faker 

    Note: If pip or pip3 command is not recognized, make sure to install pip for your Python version.

Customization

  • Changing the number of contacts generated: By default, the script generates 5000 contacts. However, users can modify the range value in the line contacts = [generate_contact() for _ in range(5000)]. Change 5000 to your desired number.

  • Changing the range of ages for generated contacts: By default, the script generates contacts with ages between 18 and 80. However, the user may want to generate contacts with different age ranges. To do this, they can modify the values of the MIN_AGE and MAX_AGE constants at the beginning of the script.

  • Changing the labels for phone numbers: the user may want to customize these labels used for phone numbers by updating the labels list in the script to better suit their needs

  • Adding or removing contact information fields: The script currently generates first name, last name, email, birthday, phone numbers, and phone number labels. If users want to include additional fields, such as company or address, they can modify the generate_contact() function accordingly. Similarly, if users want to exclude certain fields, they can simply remove the corresponding lines of code.

  • Changing the file formats generated: The script currently generates VCF, XML, CFG, JSON, and CSV files. If users only need certain file formats, they can remove the corresponding function calls at the bottom of the script.

  • Modifying the file naming convention or output directory: By default, the script saves the generated files to an "output" directory within the same directory as the script itself. Users can modify the output directory path and/or the file naming convention by changing the relevant variables at the top of the script.

Usage

  • Open the generate_contacts.py file in a text editor.

  • Customize the script if needed. For example, you can modify the number of contacts to generate by changing the value in the range() function. Save the script.

  • Open your terminal or command prompt and navigate to the directory where the script is located.

  • Run the script using the following command:

    python generate_contacts.py

    You can also run the script in any python IDE like VSCode.

  • The script will generate random contacts in various file formats, including VCF, XML, CFG, JSON, and CSV. By default, the script saves the generated files to an "output" directory within the same directory as the script itself

  • You can import the generated files into your contact manager, phone app or simulator to add the contacts

    Note: Feel free to modify the code and adapt it to your requirements. Enjoy generating contacts!

Sample Output

I have provided a sample output folder output in the repository for users to check the expected format and structure of the output files generated by the script.

Contact Information

For any questions or issues, please feel free to reach out to me

About

This script generates a specified number of random contacts in various formats, including VCF, XML, CFG, JSON, and CSV

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages