A virtual contact book in Python where users can add new contacts, and also view, edit, and delete them.
Following are the main components of the program responsible for the whole functioning:
-
new_contact()
« Click here to view the details- Function for adding a new contact to the contacts-list.
-
del_contact()
« Click here to view the details- Function for deleting a specific contact / deleting all the contacts at once.
-
edit_contact()
« Click here to view the details- Function for updating the details of a specific contact in the contact list.
-
view_contact()
« Click here to view the details- Function for viewing the details of a specific contact in the contact list.
- Global Variable
contacts
contacts
is the global dictionary variable, used by every functionality given below.
The above mentioned components constitute the main function contactBook()
------------ Contact Book ------------
Enter:-
[0] to add a New Contact
[1] to view your Contacts
[2] to edit a Previously Existing Contact
[3] to delete a Previously Existing Contact
Enter your choice:
The function begins with an indefinite while loop, where, it asks the user for their choice of action using simple selection statements. After the completetion of each iteration, it asks the user whether to open the contact book again.
Do you want to open your Contact Book again (y/n) ?:
The contacts are saved only during the program execution. After termination, the contacts are not saved externally.
To use the program you would have to get an executable file for the code.
Follow these steps to get along:-
-
Add Python to PATH
- An easy way to add Python to the path is by downloading a recent version of Python, and then checking the box to "Add Python to PATH"1 at the beginning of the installation
-
Install
pyinstaller
- Open your terminal and write the command:-
pip install pyinstaller
. This will getpyinstaller
installed in your machine in less than a minute's time.
- Open your terminal and write the command:-
-
Save your Python Script
- Save your Python Script file by any name you wish (
<file_name>
), now open the Windows Powershell2 in the same directory as of the file's and write the command:-pyinstaller --onfile <file_name>.py
. It'd take some time to get your executable file ready.
- Save your Python Script file by any name you wish (
-
Open your Executable
- When it is done, open the newly made
dist
folder, and you would find your executable file for the program. An example of the file location can be:-E:\Projects\Contact-Book\Contact-Book\dist
- When it is done, open the newly made
Run your executable and let us know how was the program experience!
For a better understanding on How to create Executable of Python Script using Pyinstaller click here.
- Contact-Book made functional for terminal-use.
- Contact-Book made more functional by saving contacts externally.
- Conact-Book equipped with GUI3
I had made this project for improving my programming skills (especially in Python). Completing this much of the project was just the 1st step towards the final completion. What I aspire to be the 2nd, and certainly the last step for this project is the implementation of SQL4 database using the sqlite3
module.
This would not only allow the user to use the program for real life use, but also strengthen our command in the field of Database Management in Python. I hope it'd get done soon ^_^
There are various ways you can contribute to the project!
-
Pull Requests:
Pull Requests regarding features that were previously non-existent; or that could be made better
-
Raising Issues:
Found an Issue troubling you? Feel free to raise an issue regarding that and I, and the other contributers would definitely look into it.
-
Contributions for the README.md file!
Can you help us making the README.md file look better, more beautiful, and functional? Go on! We'd be there for you with full coordination.
Footnotes
-
Navigate to the Windows Powershell by hitting
Shift
+Right click
in the directory. Check this article for more information. ↩ -
Graphical User Interface; The final stage of development for this project would be integrating GUI using modules like tkinkter. ↩
-
Structured Query Language is a standard language for storing, manipulating and retrieving data in databases.
sqlite3
provides an SQL interface compliant with the DB-API 2.0 specification described by PEP 249. ↩