Skip to content

A command-line Contact Manager built in Python, designed for simple and efficient CRUD operations.

Notifications You must be signed in to change notification settings

aarya095/Contant-Manager

Repository files navigation

🗂️ Contact Manager (CLI)

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.

📌 Navigate

Features

Available Operations

  1. Create Contact
    Adds a new contact. User is prompted for required fields.
  2. ✏️ Update Contact
    Modifies an existing contact. Requires an existing contact name.
  3. 👁️ View Contact
    Displays all stored contacts in order.
  4. Delete Contact
    Permanently removes a contact. Requires an existing contact name.
  5. 🔍 Search Contact
    Allows searching by name using regex-based lookup.
  6. 💾 Export Contacts
    Exports all contact data to contacts_data.json.
  7. ℹ️ Help
    Displays the application's manual.
  8. 🚪 Exit
    Closes the application.

📝 Instructions

  • Enter only integer indices.
  • Invalid inputs trigger an error message; re-enter a valid number.
  • Follow on-screen prompts for each operation.

CLI Preview

Introductory Message

Intro Message

Create Entry Demo

Create Entry

View Entry Demo

View Entry

Update Entry Demo

Update Entry

Delete Entry Demo

Delete Entry

Search Demo

Search Entry

Exporting to JSON

Export 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

Exiting Message

Database

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.


Validation and Utilities

  • 📧 Email Validation: Implemented using the validators package.
  • 💾 Exporting: Performed via the json module and standard file operations.
  • 🔎 Search: Uses the re module with search() and IGNORECASE.
  • ⚙️ CRUD: Full create, read, update, delete functionality is implemented.

Project Structure

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.

Usage

Run the application:

python main.py

Requirements

  • 🐍 Python 3.x
  • 🔑 cryptography==46.0.3
  • 📧 validators==0.35.0
  • 📝 dotenv==0.9.9
  • ▶️ colorama==0.4.6

Author

Aarya Sarfare
IT Engineering student | Building in Full Stack Development and Cybersecurity

About

A command-line Contact Manager built in Python, designed for simple and efficient CRUD operations.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages