command to install.
pip install termcolor
Each component serves a specific purpose within the application:
- model.py: Defines the Contact class to structure contact information.
- database.py: Manages the storage and retrieval of contacts using a dictionary data structure and pickle files.
- views.py: Provides user interaction and a menu system, allowing users to input choices and interact with contacts.
- main.py: The main entry point for the application, where the user interacts with the ContactsBook and initiates contact-related actions.
- contacts.py: The primary entry point for running the application.
2. Search for an Existing Contact Users can search for existing contacts using various criteria, such as First Name, Last Name, Email, Phone, and Job Title. The application can return multiple entries if multiple contacts match the criteria.
3. Edit an Existing Contact Users can edit the details of an existing contact, including fields such as First Name, Last Name, Email, Phone, and Job Title. After making changes, the program asks for confirmation to save the edited contact.
4. Delete a Contact Users can delete an existing contact from the list.
5. Display All Contacts The program can display the details of all stored contacts.
6. Save and Restore Contact List Contacts are saved into a pickle file when exiting the program. The program also prompts users for a file path to save/update the pickle file. When the program is restarted, it restores the previously saved contact list.
The menu and user prompts are colorized using the termcolor library, enhancing the user interface and providing a better visual experience. To run the ContactsBook application, execute the contacts.py script. Upon startup, the program will ask for the file path to save the contact data. Users can then interact with the application by selecting options from the menu. The ContactsBook application is a versatile tool for managing and organizing contact information. With a clear directory structure, easy-to-use menu system, and colorful interface, it offers an intuitive and visually pleasing way to handle contact-related tasks.