Skip to content

basillio/GoIT-Python-final

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Assistant Phonebook - Complete Application

Date: 2026-05-30 Status: βœ… COMPLETE AND PRODUCTION READY Version: 2.8 - UI Refactoring Complete Ready to Use: YES


Quick Start

Run Application

python main.py

Or double-click: run.bat


Application Overview

The Assistant Phonebook is a complete, production-ready contact and note management application built with Python and Tkinter. Version 2.8 features a component-based UI architecture with 6 reusable components for improved maintainability and extensibility.

Main Features

  • Dual Interfaces - GUI mode and CLI mode with complete feature parity
  • Contacts Management - Add, edit, delete, search contacts with 7 fields
  • Notes Management - Create notes with auto-generated titles and tag filtering
  • Birthday Notifications - Automatic alerts with configurable settings (0-365 days)
  • Global Search - Unified search across contacts and notes
  • Component-Based UI - 6 reusable components for better code organization
  • Data Persistence - All data saved to JSON files
  • Professional UI - Clean, organized interface with ASCII contact cards
  • Intelligent Command Processing - Auto-corrects broken keyboard layouts and guesses commands from partial input.
  • Advanced Notes Sorting - Enhanced sorting mechanics for notes.
  • Smart Contact Selection - Quick search and action invocation by contact name instead of just ID.
  • Visual Enhancements - Color-coded search results for notes (green) and integrated UI icons.
  • System Statistics - Built-in analytical charts/metrics dashboard.

Contacts Tab

Features

βœ… Add, edit, delete contacts βœ… Real-time search by name, phone, email, tags βœ… Contact card preview (14 lines) βœ… Field validations with error messages βœ… Gray field templates βœ… Birthday notifications βœ… Configurable settings βœ… Data persistence to contacts.json βœ… Real-time search by name, phone, email, tags βœ… Search by name for instant actions (view/update/delete) βœ… Intelligent command guessing and auto-correction βœ… Integrated visual icons for contact actions

Contact Fields

  • Name (required)
  • Phone 1 & 2 (optional)
  • Email (optional)
  • Birthday (YYYY-MM-DD format)
  • Tags (comma-separated)
  • Note (any text)

Notes Tab

Features

βœ… Add, edit, delete notes βœ… Custom or auto-generated titles (YYYY-MM-DD HH:MM) βœ… Real-time search by text or tags βœ… Treeview display with Title and Tags columns βœ… Sortable columns (click headers) βœ… Dropdown checkbox tag filtering βœ… Multiple tag selection βœ… Data persistence to notes.json βœ… Sortable columns with advanced note sorting βœ… Green color highlighting for notes search results

Note Fields

  • Title (optional, auto-generates if empty)
  • Note Text (required, max 5000 chars)
  • Tags (comma-separated)

How to Filter Notes

  1. Click "Tags β–Ό" button to open dropdown
  2. Check one or more tags
  3. Notes list updates instantly
  4. Selected tags shown in blue label
  5. Click "All Tags" to show all notes

Birthday Notifications

Features

βœ… Automatic alerts on application startup βœ… Configurable notification timing βœ… Non-blocking popup (main window interactive) βœ… Settings saved to settings.json

Notification Options

  • On the day of birthday
  • 1 day before birthday
  • 2 days before birthday
  • 3 days before birthday
  • 7 days before birthday
  • 14 days before birthday

How to Configure

  1. Click "Settings" button in Contacts tab
  2. Check desired notification days
  3. Click "Save" to save settings
  4. Click "Cancel" to discard changes

Data Files

contacts.json

  • Stores all contact data
  • Auto-created on first save
  • Sample data included

notes.json

  • Stores all note data
  • Auto-created on first save
  • Sample data included

settings.json

  • Stores user preferences
  • Birthday notification days
  • Auto-created on first save

Application Files

Core Files (8 files, 2,395 lines)

  • main.py (57 lines) - Application entry point with mode selection
  • ui.py (641 lines) - GUI implementation (refactored v2.8)
  • ui_components.py (393 lines) - 6 reusable UI components (NEW in v2.8)
  • cli.py (872 lines) - CLI interface with interactive and command-line modes
  • phonebook.py (177 lines) - Contact management
  • notes.py (125 lines) - Note management
  • config.py (58 lines) - Configuration settings
  • utils.py (72 lines) - Utility functions

Data Files

  • contacts.json - Contact data
  • notes.json - Note data
  • settings.json - User settings

Configuration

  • .gitignore - Git ignore rules for Python, system files, and IDE files

Features Summary

Contact Management

  • Add new contacts with validation
  • Edit existing contacts
  • Delete contacts with confirmation
  • Search contacts in real-time
  • View contact card preview
  • Birthday notifications
  • Configurable settings

Note Management

  • Add new notes with custom or auto-generated titles
  • Edit existing notes
  • Delete notes with confirmation
  • Search notes in real-time
  • Sort by Title or Tags
  • Filter by multiple tags
  • Tag support for organization

Advanced Features

  • Birthday notifications on startup
  • Configurable notification timing
  • Settings persistence (save/cancel)
  • Non-blocking popups
  • Professional tabbed interface
  • Complete field validations
  • Smart color handling
  • Direct editing workflow

🧠 Intelligent & Advanced Features

Intelligent Command Guessing

  • The CLI assistant automatically predicts what the user wants to execute based on partial text input.
  • Includes automatic Ukrainian-to-English keyboard layout correction (e.g., typing Ρ„Π²Π² automatically triggers add, Ρ–ΡƒΠ° triggers search, ΠΌΡˆΡƒΡ† triggers view).

Smart Action by Name

  • Users no longer need to look up and type exact contact IDs for operations.
  • Typing the beginning of a contact's name in View, Update, or Delete menus instantly matches and auto-selects the correct record.

System Statistics

  • New analytics module providing detailed statistics about saved contacts, note counts, tag usage distributions, and upcoming birthdays.

UI & UX

  • Green Color Highlights: Search results in the notes view are now highlighted in green for better contrast and visibility.
  • UI Icons: Visual icons added across components to make navigation intuitive.
  • Streamlined Inputs: Refactored and stabilized input fields handling to prevent crashes and filter trailing whitespaces instantly.
  • Text Aliases: Full support for natural language words (like list, add, edit, remove) alongside traditional numeric menu choices.

Validation Rules

Contact Fields

  • Name: Required, max 100 characters
  • Phone: Min 7 chars, digits/+/-/()
  • Email: Valid email format
  • Birthday: YYYY-MM-DD format
  • Tags: Comma-separated, max 50 chars each

Note Fields

  • Title: Optional, max 100 characters
  • Note Text: Required, max 5000 characters
  • Tags: Comma-separated, max 50 chars each

How to Use

Add Contact

  1. Click "New Contact" button
  2. Fill in contact details
  3. Click "Save"

Edit Contact

  1. Click contact in list
  2. Edit fields
  3. Click "Save"

Delete Contact

  1. Click contact in list
  2. Click "Delete"
  3. Confirm deletion

Search Contacts

  1. Type in search box
  2. List filters in real-time
  3. Click "Clear" to reset

Add Note

  1. Click "New Note" button
  2. Enter title (optional)
  3. Enter note text and tags
  4. Click "Save"

Filter Notes

  1. Click "Tags β–Ό" button
  2. Check one or more tags
  3. Notes list updates instantly
  4. Click "All Tags" to reset

Sort Notes

  1. Click "Title" header to sort by title
  2. Click "Tags" header to sort by tags
  3. Click again to reverse sort order

System Requirements

  • Python 3.7 or higher
  • Tkinter (usually included with Python)
  • Windows, macOS, or Linux
  • 10 MB disk space

File Structure

D:\Projects\Assit-bot\
β”œβ”€β”€ main.py                    # Entry point with mode selection
β”œβ”€β”€ ui.py                      # GUI implementation (refactored)
β”œβ”€β”€ ui_components.py           # 6 reusable UI components (NEW)
β”œβ”€β”€ cli.py                     # CLI interface
β”œβ”€β”€ phonebook.py               # Contact management
β”œβ”€β”€ notes.py                   # Note management
β”œβ”€β”€ config.py                  # Configuration
β”œβ”€β”€ utils.py                   # Utilities
β”œβ”€β”€ .gitignore                 # Git ignore rules (NEW)
β”œβ”€β”€ contacts.json              # Contact data
β”œβ”€β”€ notes.json                 # Notes data
β”œβ”€β”€ settings.json              # User settings
└── Documentation\
    β”œβ”€β”€ README.md              # This file
    β”œβ”€β”€ INSTALLATION.md        # Installation guide
    β”œβ”€β”€ USER_GUIDE.md          # GUI user guide
    β”œβ”€β”€ CLI_GUIDE.md           # CLI guide
    β”œβ”€β”€ QUICK_REFERENCE.md     # Quick reference
    β”œβ”€β”€ TECHNICAL.md           # Technical details
    β”œβ”€β”€ INDEX_FINAL.md         # Complete project index
    └── [other documentation]

UI Components (v2.8)

The application now uses 6 reusable UI components:

  1. SearchComponent - Global search with dropdown results
  2. BirthdayComponent - Birthday notifications management
  3. ContactFormComponent - Contact form with all fields
  4. ContactCardComponent - ASCII contact card preview
  5. NoteFormComponent - Note form with title, content, tags
  6. TagFilterComponent - Multi-select tag filtering

Dual Interfaces

GUI Mode

  • Interactive Tkinter interface
  • Real-time search with dropdown
  • Contact card preview
  • Birthday notifications
  • Settings dialog

CLI Mode

  • Interactive menu system
  • Command-line arguments
  • Complete feature parity with GUI
  • Multi-line input support

Summary

The Assistant Phonebook is a complete, production-ready application with:

βœ… Dual interfaces (GUI + CLI) βœ… Intelligent command processing & layout fixes βœ… Contact selection by Name instead of ID βœ… System statistics dashboard βœ… Green-highlighted notes search results βœ… Integrated UI icons and text commands βœ… Professional contact management βœ… Professional note management βœ… Birthday notifications (0-365 days) βœ… Global search functionality βœ… Real-time search with dropdown βœ… Data persistence βœ… Comprehensive field validations βœ… Component-based UI architecture βœ… Complete documentation (17 files) βœ… 100% backward compatible

Status: βœ… COMPLETE AND PRODUCTION READY Version: 2.8 Ready to Use: YES

Simply run python main.py to start!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors