toddbirchard / group-contacts

Accepts a JSON input of user data and groups entries with common phone numbers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Contact Grouper

Python Toolz GitHub Last Commit GitHub Issues GitHub Stars GitHub Forks

Accepts a JSON input of user data and groups entries with common phone numbers.

How To Use

Contact Grouper reads from a JSON file saved locally to ./data/user.json. To use this script with custom input, simply modify users.json with new data while retaining the JSON structure.

Installation

With Pipenv:

$ git clone https://github.com/toddbirchard/group-contacts.git
$ cd group-contacts
$ pipenv update
$ pipenv shell
$ python3 main.py

With Pip:

$ git clone https://github.com/toddbirchard/group-contacts.git
$ cd group-contacts
$ pip3 install -r requirements.txt
$ python3 main.py

Expected Output

Running the script as-is should produce the following result:

{
  '123-456-7890': [
    { 'email': 'x@yieldmo.com', 'name': 'Mr. X', 'phone': '123-456-7890' },
    { 'email': 'x@gmail.com', 'name': 'Mr. X1', 'phone': '123-456-7890' }
  ],
  '456-789-1234': [
    { 'email': 'y@yieldmo.com', 'name': 'Ms. Y', 'phone': '456-789-1234' }
  ],
  '456-789-9999': [
    { 'email': 'y@yieldmo.com', 'name': 'Ms. Y1', 'phone': '456-789-9999' }
  ]
}

About

Accepts a JSON input of user data and groups entries with common phone numbers.


Languages

Language:Python 100.0%