🛠
Practice Projects · ★★
OOP · JSON · Search · Sort · CSV export
Project 7 — Contacts Manager
Build an object-oriented contacts manager with name, phone, email, and tags. Support search, sort, and CSV/JSON export.
OOPJSONCSVsearchcontacts
Duration
⏱ 2.5 hours
Level
📊 Intermediate Applied
Prerequisite
🎯 Intermediate Week 7
OUTCOME
An OOP contacts app with search, sort, and export features
What you'll learn
- 1Model a Contact with a dataclass
- 2Implement ContactBook CRUD operations
- 3Full-text search across all fields
- 4Export to CSV and JSON formats
Features
- Contact: name, phones (list), emails (list), tags (list), notes
- Commands: add, show, edit, delete, search, list, export csv/json, quit
- Search: case-insensitive full-text across name, email, tags
- Sort: by name (default), by date added
Sample Session
text
> add
Name: Alice Johnson
Phone: 010-1234-5678
Email: alice@example.com
Tags (comma-sep): work, python
Contact saved.
> search python
[1] Alice Johnson 010-1234-5678 alice@example.com [work, python]
> export csv contacts.csv
Exported 1 contacts to contacts.csv📝 Exercises
Try them yourself first, then open the solution to compare.
Exercise 1
Build the contacts manager
Goal: Implement the contacts manager with all features.
Requirements
- Contact dataclass with all fields
- CRUD + search
- JSON persistence
- CSV export
Example code / lecture materials
All lecture materials and example code are openly available on GitHub.
View on GitHub ↗