Skip to content

Commit c16b1c8

Browse files
feat: add more projects
1 parent 4bbf0f8 commit c16b1c8

File tree

7 files changed

+512
-0
lines changed

7 files changed

+512
-0
lines changed

Projects/ContactBook/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Contact Book Project\n\nBuild a contact management system to store and organize personal and professional contacts.\n\n## Project Overview\n\n**What you'll build**: A contact book application that stores contact information, supports searching and filtering, and maintains data persistence.\n\n**What you'll learn**:\n- Object-oriented programming with classes\n- Data validation and input sanitization\n- File operations and data persistence\n- Search and filtering algorithms\n- Database basics (optional advanced feature)\n\n## Project Features\n\n### Core Features\n- Add new contacts with multiple fields\n- Edit existing contact information\n- Delete contacts from the book\n- Search contacts by name, phone, or email\n- Display all contacts in organized format\n- Save/load contacts to/from file\n\n### Advanced Features\n- Contact categories and groups\n- Import/export contacts (CSV, JSON)\n- Contact photos and additional fields\n- Backup and restore functionality\n- Advanced search with filters\n- Contact statistics and analytics\n\n## Implementation Guide\n\n### Phase 1: Contact Class Design\n**Time**: 2-3 hours\n\nCreate the Contact class and basic operations:\n- Design Contact class with properties\n- Add methods for contact manipulation\n- Implement basic contact list management\n- Create simple command-line interface\n\n**Key concepts**: Classes, objects, methods, data encapsulation\n\n### Phase 2: Data Persistence\n**Time**: 2-3 hours\n\nAdd file operations:\n- Save contacts to JSON file\n- Load contacts on program start\n- Handle file errors and corruption\n- Implement backup system\n\n**Key concepts**: File I/O, JSON serialization, error handling\n\n### Phase 3: Search and Validation\n**Time**: 3-4 hours\n\nEnhance functionality:\n- Input validation for email, phone numbers\n- Advanced search capabilities\n- Contact sorting options\n- Data integrity checks\n\n**Key concepts**: Regular expressions, data validation, search algorithms\n\n### Phase 4: GUI and Advanced Features\n**Time**: 4-5 hours\n\nBuild graphical interface:\n- Contact list display with details\n- Add/edit contact forms\n- Search and filter interface\n- Import/export functionality\n\n**Key concepts**: GUI programming, data binding, file formats\n\n## Getting Started\n\n### Setup\n1. Plan the contact data structure\n2. Design the class hierarchy\n3. Create the user interface flow\n\n### Contact Class Design\n```python\nclass Contact:\n def __init__(self, first_name, last_name, phone=\"\", email=\"\", address=\"\"):\n self.first_name = first_name\n self.last_name = last_name\n self.phone = phone\n self.email = email\n self.address = address\n self.created_date = datetime.now()\n self.modified_date = datetime.now()\n \n def full_name(self):\n return f\"{self.first_name} {self.last_name}\"\n \n def validate_email(self):\n # Email validation logic\n pass\n \n def validate_phone(self):\n # Phone validation logic\n pass\n```\n\n### ContactBook Class\n```python\nclass ContactBook:\n def __init__(self):\n self.contacts = []\n self.filename = \"contacts.json\"\n self.load_contacts()\n \n def add_contact(self, contact):\n # Add contact to list\n pass\n \n def search_contacts(self, query):\n # Search functionality\n pass\n \n def save_contacts(self):\n # Save to file\n pass\n```\n\n## Data Structure Design\n\n### Contact Information Fields\n- **Required**: First name, last name\n- **Optional**: Phone number, email address, physical address\n- **Metadata**: Creation date, last modified date\n- **Advanced**: Birthday, company, job title, notes, categories\n\n### Data Validation Rules\n- Name fields: Non-empty, reasonable length\n- Email: Valid email format using regex\n- Phone: Valid phone number format\n- Address: Optional but structured if provided\n\n### File Storage Format\n```json\n{\n \"contacts\": [\n {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"phone\": \"+1-555-123-4567\",\n \"email\": \"[email protected]\",\n \"address\": \"123 Main St, City, State 12345\",\n \"created_date\": \"2025-10-01T10:00:00\",\n \"modified_date\": \"2025-10-01T10:00:00\",\n \"categories\": [\"work\", \"friend\"]\n }\n ],\n \"metadata\": {\n \"version\": \"1.0\",\n \"total_contacts\": 1,\n \"last_backup\": \"2025-10-01T09:00:00\"\n }\n}\n```\n\n## User Interface Design\n\n### Command Line Interface\n```\n=== CONTACT BOOK ===\n1. Add Contact\n2. View All Contacts\n3. Search Contacts\n4. Edit Contact\n5. Delete Contact\n6. Export Contacts\n7. Import Contacts\n8. Exit\n\nChoose an option: \n```\n\n### Contact Display Format\n```\n[1] John Doe\n Phone: +1-555-123-4567\n Email: [email protected]\n Address: 123 Main St, City, State 12345\n Categories: work, friend\n Added: 2025-10-01\n```\n\n## Core Functionality Implementation\n\n### Search Features\n- Search by name (partial matches)\n- Search by phone number\n- Search by email address\n- Filter by categories\n- Advanced search with multiple criteria\n\n### Data Validation Examples\n```python\nimport re\n\ndef validate_email(email):\n pattern = r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$'\n return re.match(pattern, email) is not None\n\ndef validate_phone(phone):\n # Remove non-digit characters for validation\n digits = re.sub(r'\\D', '', phone)\n return len(digits) >= 10\n```\n\n### Import/Export Features\n- Export to CSV for spreadsheet compatibility\n- Export to JSON for backup/restore\n- Import from various formats\n- Data mapping and conversion\n\n## Testing Your Contact Book\n\n### Test Scenarios\n- Add contacts with various field combinations\n- Test search functionality with different queries\n- Validate email and phone number formats\n- Test file save/load operations\n- Import/export with sample data\n- Handle edge cases (empty fields, special characters)\n\n### Data Integrity Tests\n- Duplicate contact detection\n- Data corruption recovery\n- Large contact list performance\n- Concurrent access handling\n\n## Extensions and Improvements\n\n### Beginner Extensions\n- Contact photos and avatars\n- Birthday reminders\n- Contact notes and comments\n- Simple contact sharing\n\n### Intermediate Extensions\n- Database storage (SQLite)\n- Contact synchronization with phone/email\n- Advanced contact analytics\n- Contact relationship mapping\n\n### Advanced Extensions\n- Cloud synchronization\n- Multi-user support with permissions\n- Integration with email clients\n- API for external applications\n\n## Common Issues and Solutions\n\n**Issue**: Contact data becomes corrupted\n**Solution**: Implement data validation and automatic backups\n\n**Issue**: Search becomes slow with many contacts\n**Solution**: Implement indexing and optimized search algorithms\n\n**Issue**: Import fails with different file formats\n**Solution**: Add robust file format detection and conversion\n\n**Issue**: Duplicate contacts created\n**Solution**: Implement duplicate detection based on multiple fields\n\n## Learning Outcomes\n\nAfter completing this project, you'll understand:\n- Object-oriented programming principles\n- Data validation and sanitization techniques\n- File operations and data serialization\n- Search and filtering algorithms\n- User interface design patterns\n- Error handling and data integrity\n\n## File Structure\n\n```\ncontact_book/\n├── models/\n│ ├── contact.py # Contact class definition\n│ └── contact_book.py # ContactBook class\n├── utils/\n│ ├── validation.py # Data validation functions\n│ └── file_handler.py # File I/O operations\n├── ui/\n│ ├── cli_interface.py # Command-line interface\n│ └── gui_interface.py # Graphical interface (optional)\n├── data/\n│ ├── contacts.json # Main contact data\n│ └── backups/ # Backup files\n├── tests/\n│ └── test_contacts.py # Unit tests\n└── README.md # Project documentation\n```\n\n## Next Steps\n\nOnce you've completed your contact book:\n1. Add your real contacts and use it daily\n2. Implement your most-wanted features\n3. Share with friends and get feedback\n4. Consider mobile app version\n5. Try the Expense Tracker project next for more data management\n\nExcellent work on building a practical data management application!

Projects/DataDashboard/README.md

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

Projects/ExpenseTracker/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Expense Tracker Project\n\nBuild a personal finance management tool to track income, expenses, and analyze spending patterns.\n\n## Project Overview\n\n**What you'll build**: An expense tracking application that records financial transactions, categorizes spending, and provides insights into your financial habits.\n\n**What you'll learn**:\n- Working with dates and time data\n- Data analysis and visualization\n- File operations and data persistence\n- Mathematical calculations and statistics\n- Creating reports and summaries\n\n## Project Features\n\n### Core Features\n- Add income and expense transactions\n- Categorize transactions (food, transport, entertainment, etc.)\n- View transaction history\n- Calculate totals and balances\n- Generate monthly/yearly reports\n- Data persistence across sessions\n\n### Advanced Features\n- Budget planning and tracking\n- Spending analysis with charts\n- Recurring transaction support\n- Export data to various formats\n- Multi-currency support\n- Financial goal tracking\n\n## Implementation Guide\n\n### Phase 1: Basic Transaction Management\n**Time**: 2-3 hours\n\nCreate core transaction functionality:\n- Transaction class design\n- Add/view transactions\n- Basic categorization\n- Simple calculations\n\n**Key concepts**: Classes, date handling, basic math operations\n\n### Phase 2: Data Analysis\n**Time**: 3-4 hours\n\nAdd analysis features:\n- Monthly/yearly summaries\n- Category-wise breakdown\n- Balance calculations\n- Trend analysis\n\n**Key concepts**: Data aggregation, statistical calculations, date operations\n\n### Phase 3: Reporting and Visualization\n**Time**: 3-4 hours\n\nImplement reporting:\n- Generate detailed reports\n- Create simple charts and graphs\n- Export functionality\n- Budget vs actual comparisons\n\n**Key concepts**: Data visualization, file export, report generation\n\n### Phase 4: Advanced Features\n**Time**: 4-5 hours\n\nAdd sophisticated functionality:\n- Budget planning interface\n- Recurring transactions\n- Advanced filtering and search\n- Goal tracking and notifications\n\n**Key concepts**: Advanced data structures, scheduling, notification systems\n\n## Getting Started\n\n### Setup\n1. Plan the transaction data structure\n2. Design category system\n3. Create the user interface flow\n\n### Transaction Class Design\n```python\nfrom datetime import datetime\nfrom enum import Enum\n\nclass TransactionType(Enum):\n INCOME = \"income\"\n EXPENSE = \"expense\"\n\nclass Transaction:\n def __init__(self, amount, category, description, transaction_type, date=None):\n self.amount = float(amount)\n self.category = category\n self.description = description\n self.type = transaction_type\n self.date = date or datetime.now()\n self.id = self.generate_id()\n \n def generate_id(self):\n # Generate unique transaction ID\n pass\n```\n\n### ExpenseTracker Class\n```python\nclass ExpenseTracker:\n def __init__(self):\n self.transactions = []\n self.categories = {\n 'expense': ['Food', 'Transport', 'Entertainment', 'Utilities', 'Other'],\n 'income': ['Salary', 'Freelance', 'Investment', 'Gift', 'Other']\n }\n self.load_data()\n \n def add_transaction(self, amount, category, description, transaction_type):\n # Add new transaction\n pass\n \n def get_balance(self):\n # Calculate current balance\n pass\n \n def get_monthly_summary(self, month, year):\n # Generate monthly report\n pass\n```\n\n## Data Structure Design\n\n### Transaction Data\n```json\n{\n \"id\": \"txn_20251001_001\",\n \"amount\": 25.50,\n \"category\": \"Food\",\n \"description\": \"Lunch at restaurant\",\n \"type\": \"expense\",\n \"date\": \"2025-10-01T12:30:00\",\n \"tags\": [\"restaurant\", \"lunch\"],\n \"payment_method\": \"credit_card\"\n}\n```\n\n### Category Structure\n```python\nCATEGORIES = {\n 'expense': {\n 'Food': ['Groceries', 'Restaurants', 'Takeout'],\n 'Transport': ['Gas', 'Public Transport', 'Taxi'],\n 'Entertainment': ['Movies', 'Games', 'Subscriptions'],\n 'Bills': ['Rent', 'Utilities', 'Internet'],\n 'Shopping': ['Clothing', 'Electronics', 'Household']\n },\n 'income': {\n 'Work': ['Salary', 'Bonus', 'Overtime'],\n 'Business': ['Sales', 'Services', 'Freelance'],\n 'Investment': ['Dividends', 'Interest', 'Capital Gains'],\n 'Other': ['Gift', 'Refund', 'Miscellaneous']\n }\n}\n```\n\n## User Interface Design\n\n### Main Menu\n```\n=== EXPENSE TRACKER ===\n1. Add Transaction\n2. View Transactions\n3. Monthly Summary\n4. Category Analysis\n5. Balance Report\n6. Budget Manager\n7. Export Data\n8. Exit\n\nCurrent Balance: $1,250.75\nChoose an option: \n```\n\n### Transaction Entry Form\n```\n=== ADD TRANSACTION ===\nType (1-Income, 2-Expense): 2\nAmount: $25.50\nCategory: Food\nDescription: Lunch at restaurant\nDate (YYYY-MM-DD) or Enter for today: 2025-10-01\n\nTransaction added successfully!\n```\n\n## Core Features Implementation\n\n### Balance Calculation\n```python\ndef calculate_balance(self):\n total_income = sum(t.amount for t in self.transactions \n if t.type == TransactionType.INCOME)\n total_expenses = sum(t.amount for t in self.transactions \n if t.type == TransactionType.EXPENSE)\n return total_income - total_expenses\n```\n\n### Monthly Summary\n```python\ndef get_monthly_summary(self, month, year):\n monthly_transactions = [\n t for t in self.transactions \n if t.date.month == month and t.date.year == year\n ]\n \n income = sum(t.amount for t in monthly_transactions \n if t.type == TransactionType.INCOME)\n expenses = sum(t.amount for t in monthly_transactions \n if t.type == TransactionType.EXPENSE)\n \n return {\n 'month': f\"{month}/{year}\",\n 'income': income,\n 'expenses': expenses,\n 'net': income - expenses,\n 'transaction_count': len(monthly_transactions)\n }\n```\n\n### Category Analysis\n```python\ndef analyze_spending_by_category(self, start_date=None, end_date=None):\n filtered_transactions = self.filter_by_date(start_date, end_date)\n expenses = [t for t in filtered_transactions \n if t.type == TransactionType.EXPENSE]\n \n category_totals = {}\n for transaction in expenses:\n category = transaction.category\n category_totals[category] = category_totals.get(category, 0) + transaction.amount\n \n return category_totals\n```\n\n## Reporting Features\n\n### Monthly Report Format\n```\n=== MONTHLY REPORT - October 2025 ===\n\nIncome:\n Salary: $3,000.00\n Freelance: $500.00\n Total: $3,500.00\n\nExpenses:\n Food: $450.00\n Transport: $200.00\n Bills: $800.00\n Other: $150.00\n Total: $1,600.00\n\nNet Income: $1,900.00\nTransactions: 45\n```\n\n### Data Export Options\n- CSV format for spreadsheet analysis\n- JSON format for backup/restore\n- PDF reports for sharing\n- Simple text summaries\n\n## Testing Your Expense Tracker\n\n### Test Scenarios\n- Add various types of transactions\n- Test date calculations and filtering\n- Verify balance calculations\n- Generate reports for different time periods\n- Test data persistence and loading\n- Handle edge cases (negative amounts, future dates)\n\n### Sample Test Data\n```python\ntest_transactions = [\n Transaction(3000, \"Salary\", \"Monthly salary\", TransactionType.INCOME),\n Transaction(25, \"Food\", \"Lunch\", TransactionType.EXPENSE),\n Transaction(50, \"Transport\", \"Gas\", TransactionType.EXPENSE),\n Transaction(100, \"Entertainment\", \"Movie tickets\", TransactionType.EXPENSE)\n]\n```\n\n## Extensions and Improvements\n\n### Beginner Extensions\n- Receipt photo attachment\n- Simple budgeting alerts\n- Currency conversion\n- Transaction search functionality\n\n### Intermediate Extensions\n- Investment tracking\n- Bill reminder system\n- Advanced data visualization\n- Mobile app synchronization\n\n### Advanced Extensions\n- Machine learning for expense prediction\n- Bank account integration\n- Multi-user family budgeting\n- Financial planning tools\n\n## Common Issues and Solutions\n\n**Issue**: Date calculations are incorrect\n**Solution**: Use datetime module properly and handle timezones\n\n**Issue**: Floating point precision errors with money\n**Solution**: Use decimal module for precise financial calculations\n\n**Issue**: Reports are slow with many transactions\n**Solution**: Implement efficient data filtering and caching\n\n**Issue**: Data loss during program crashes\n**Solution**: Implement auto-save and backup mechanisms\n\n## Learning Outcomes\n\nAfter completing this project, you'll understand:\n- Date and time manipulation in Python\n- Data analysis and aggregation techniques\n- Financial calculations and precision handling\n- Report generation and data visualization\n- File operations and data persistence\n- User interface design for data entry\n\n## File Structure\n\n```\nexpense_tracker/\n├── models/\n│ ├── transaction.py # Transaction class\n│ └── expense_tracker.py # Main tracker class\n├── utils/\n│ ├── date_utils.py # Date manipulation helpers\n│ ├── calculations.py # Financial calculations\n│ └── export_utils.py # Data export functions\n├── reports/\n│ ├── monthly_report.py # Monthly report generator\n│ └── category_report.py # Category analysis\n├── data/\n│ ├── transactions.json # Transaction data\n│ ├── categories.json # Category definitions\n│ └── backups/ # Backup files\n├── ui/\n│ ├── cli_interface.py # Command-line interface\n│ └── gui_interface.py # Graphical interface (optional)\n└── README.md # Project documentation\n```\n\n## Next Steps\n\nOnce you've completed your expense tracker:\n1. Start tracking your real expenses!\n2. Analyze your spending patterns\n3. Set up budgets and financial goals\n4. Share insights with family or friends\n5. Try the Web Scraper project next for data collection skills\n\nFantastic work on building a practical financial management tool!

0 commit comments

Comments
 (0)