A powerful, user-friendly, and persistent contact book built with Python. Designed with OOP principles, partial editing, and robust data persistence โ perfect for managing your contacts from the terminal.
โจ Add Contacts โ Store name, family, and phone
๐ Smart Search โ Find by name, family, or number (case-insensitive & partial match)
โ๏ธ Partial Edit โ Change only what you need (e.g., just the phone number)
๐๏ธ Remove Contacts โ Clean up your list
๐พ Auto-Save & Load โ Data persists between sessions using JSON
๐ Unicode Support โ Works perfectly with Persian, Arabic, and special characters
๐งฏ Error Resilient โ Handles invalid inputs and corrupted files
โจ๏ธ Graceful Exit โ Press Ctrl+C anytime โ your data is saved safely
๐งฉ OOP Design โ Clean separation of Contact and ContactBook classes
-
Clone the repo:
git clone https://github.com/hasan1369sh/Python-Contact-Book.git
-
Go to the project: cd Python-Contact-Book
-
Run it: python contact_book.py
"๐ก No dependencies. Just pure Python ๐ "
๐ฎ Demo: Partial Editing (Game Changer!) Imagine you only want to update a phone number โ no need to retype everything:
Current info: Hasan Sherafat - 09900000000 Leave blank to keep current value.
New first name (current: Hasan): New last name (current: Sherafat): New phone (current: 09900000000): 09999999999
โ Contact updated: Hasan Sherafat - 09999999999
"๐ฅ You only changed the phone โ the rest stayed intact. "
๐ ๏ธ Data Structure Each contact is stored in contacts.json as:
{
"name": "Hasan",
"family": "Sherafat",
"phone": "09999999999"
}
All data is saved with ensure_ascii=False โ full Unicode support guaranteed.
๐ง Future Roadmap Add email, address, and birthday fields Sort contacts by name Export to CSV or vCard
๐ค Author ๐ค Hasan Sherafat ๐ง hasan.sherafat.69@gmail.com ๐ GitHub Profile