Introduction
The best way to learn programming is by building real projects. This module showcases complete Python applications from the bootcamp, demonstrating how to apply Python fundamentals and OOP concepts to solve real problems.Featured Project: Contact Management System
Project Overview
Project Type
Console Application
Language
Python 3.7+
Concepts
OOP, File I/O, JSON
Tests
22 Unit Tests
Project Status:

Key Features
- CRUD Operations: Complete Create, Read, Update, Delete functionality
- Flexible Search: Search by name (partial match) or phone (exact match)
- Data Validation: Input validation with descriptive error messages
- JSON Persistence: Automatic save/load of contacts
- User-Friendly Interface: Interactive menu-driven CLI
- Unit Tests: Comprehensive test coverage with
unittest
Project Architecture
File Structure
Design Pattern: Separation of Concerns
Design Pattern: Separation of Concerns
The project follows a clean architecture:
- Data Layer (
contact.py): Defines the Contact model - Business Logic Layer (
contact_manager.py): Handles operations and persistence - Presentation Layer (
main.py): Manages user interaction
- Easier to test
- More maintainable
- Reusable in different contexts
Core Components
- Contact Model
- Contact Manager
- CLI Interface
The
Contact class represents a single contact with encapsulation:Implementation Details
Data Persistence with JSON
The application uses JSON for data persistence, making it human-readable and easy to debug:Search Functionality
The system implements two types of search:- Name Search (Partial Match)
- Phone Search (Exact Match)
- Case-insensitive search
- Partial matches (“Juan” finds “Juan García”)
- Returns list of all matching contacts
Edit and Delete Operations
Testing
Unit Tests
The project includes comprehensive unit tests covering all functionality:Test Coverage: The test suite includes 22 tests covering:
- Contact creation and validation
- Property getters and setters
- CRUD operations
- Search functionality
- Data persistence
- Error handling
Running Tests
Usage Examples
Basic Usage
Project Benefits
Clean Architecture
Separation of concerns between data, business logic, and presentation layers
Data Validation
Input validation with descriptive error messages prevents invalid data
Persistent Storage
JSON-based storage ensures data survives between sessions
Test Coverage
Comprehensive unit tests ensure code reliability and catch regressions
User-Friendly
Interactive CLI with clear prompts and visual feedback (✅/❌)
Type Safety
Type hints throughout improve code clarity and IDE support
Technologies Used
- Python 3.7+: Core programming language
- json: Built-in module for data persistence
- os: File system operations
- unittest: Built-in testing framework
- typing: Type hints for better code quality
No External Dependencies: The project uses only Python’s standard library, making it easy to run in any Python 3.7+ environment.
Key Takeaways
This project demonstrates several important software development concepts:- Object-Oriented Design: Clean class structure with encapsulation
- CRUD Operations: Complete Create, Read, Update, Delete functionality
- Data Persistence: Loading and saving data with JSON
- Error Handling: Try-except blocks and validation
- Testing: Unit tests with setUp/tearDown
- User Experience: Clear interface with visual feedback
- Code Organization: Separation of concerns across modules
Practice Exercises
Exercise 1: Add Export Feature
Exercise 1: Add Export Feature
Add a method to export contacts to CSV format:Hint: Use Python’s
csv module.Exercise 2: Add Contact Categories
Exercise 2: Add Contact Categories
Extend the Contact class to include a category field (family, work, friends) and add filtering by category.Hint: Update the
__init__ method and add a new search method.Exercise 3: Add Email Validation
Exercise 3: Add Email Validation
Implement email format validation in the Contact class using regular expressions.Hint: Use the
re module and validate in the email setter.Next Steps
Python Basics
Review fundamental Python concepts
Object-Oriented Programming
Deep dive into OOP principles