A command-line Contact Manager built in Python, designed for simple and efficient CRUD operations. The application functions through an indexed menu system—select an operation by entering its corresponding number.
- Features
- CLI Preview
- Database Schema
- Validation and Utilities
- Project Structure
- Usage
- Requirements
- Author
-
➕ Create Contact
Adds a new contact. User is prompted for required fields. -
✏️ Update Contact
Modifies an existing contact. Requires an existing contact name. -
👁️ View Contact
Displays all stored contacts in order. -
❌ Delete Contact
Permanently removes a contact. Requires an existing contact name. -
🔍 Search Contact
Allows searching by name using regex-based lookup. -
💾 Export Contacts
Exports all contact data tocontacts_data.json. -
ℹ️ Help
Displays the application's manual. -
🚪 Exit
Closes the application.
- Enter only integer indices.
- Invalid inputs trigger an error message; re-enter a valid number.
- Follow on-screen prompts for each operation.
Introductory Message
Create Entry Demo
View Entry Demo
Update Entry Demo
Delete Entry Demo
Search Demo
Exporting to JSON
[{"Name": "india", "Contact Number": "1231231231", "Email": "india@qwe.qwe"},
{"Name": "kirti", "Contact Number": "6784566544", "Email": "kirti@gotmail.com"},
{"Name": "omkar", "Contact Number": "9874569874", "Email": "omkar_90@hotmail.in"},
{"Name": "harsh", "Contact Number": "4564564564", "Email": "harsh_01@email.com"}]
Exiting Message
The application uses SQLite3 for storage.
Schema:
[(0, 'name', 'TEXT', 0, None, 0), (1, 'contact_number', 'INT', 0, None, 0), (2, 'email', 'TEXT', 0, None, 0)]
The contact number and email fields are stored in encrypted form using 🔑 Fernet from the cryptography package.
Their keys are stored in a .env file and loaded using python-dotenv.
- 📧 Email Validation: Implemented using the
validatorspackage. - 💾 Exporting: Performed via the
jsonmodule and standard file operations. - 🔎 Search: Uses the
remodule withsearch()andIGNORECASE. - ⚙️ CRUD: Full create, read, update, delete functionality is implemented.
contacts_data.db contacts_data.json requirements.txt main.py modules/ ├── __init__.py ├── database.py ├── encryption.py ├── get_and_validate_user_input.py └── operations.py
- 🗄️ database.py — Handles SQLite3 connection and queries.
- 🔐 encryption.py — Encrypts and decrypts email & contact number.
- 📝 get_and_validate_user_input.py — Input validation functions.
- ⚙️ operations.py — Implements CRUD, search, export, and help functions.
▶️ main.py — Runs the application.
Run the application:
python main.py
- 🐍 Python 3.x
- 🔑 cryptography==46.0.3
- 📧 validators==0.35.0
- 📝 dotenv==0.9.9
▶️ colorama==0.4.6
Aarya Sarfare
IT Engineering student | Building in Full Stack Development and Cybersecurity