https://github.com/yevheniidatsenko/goit-pycore-hw-07
🐍 Hometask - Python course (Python Address Book with Advanced Features)
https://github.com/yevheniidatsenko/goit-pycore-hw-07
goit goit-pycore-hw-07 python3
Last synced: 2 months ago
JSON representation
🐍 Hometask - Python course (Python Address Book with Advanced Features)
- Host: GitHub
- URL: https://github.com/yevheniidatsenko/goit-pycore-hw-07
- Owner: yevheniidatsenko
- Created: 2024-05-18T17:09:42.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-18T19:42:52.000Z (over 1 year ago)
- Last Synced: 2025-04-05T00:28:24.641Z (7 months ago)
- Topics: goit, goit-pycore-hw-07, python3
- Language: Python
- Homepage:
- Size: 143 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Python Address Book with Advanced Features
This project enhances the previous Python Address Book tasks with additional functionalities, including:
- **Birthday Management:**
- `add-birthday` command to add a birthday to a contact.
- `show-birthday` command to display a contact's birthday.
- `birthdays` command to list upcoming birthdays for the next week.
- **Data Validation:**
- Validates birthday format (DD.MM.YYYY).
- Validates phone number format (10 digits).
- **Graceful Exit:**
- Handles `close` or `exit` commands to properly terminate the program.### Installation
1. Install Python 3.x if you haven't already.
2. Download the provided code files.### Usage
1. Open a terminal or command prompt.
2. Navigate to the directory containing the code files.
3. Run the program using `python main.py`.
4. Follow the prompts and commands to interact with the address book.### Features
- **Add Contacts:**
- Use `add [name] [phone]` to add a new contact or update an existing one.
- **Change Phone Number:**
- Use `change [name] [old_phone] [new_phone]` to modify a contact's phone number.
- **Display Contacts:**
- Use `phone [name]` to show a contact's phone numbers.
- Use `all` to display all contacts in the address book.
- **Birthday Management:**
- Use `add-birthday [name] [birthday]` to add a birthday to a contact.
- Use `show-birthday [name]` to display a contact's birthday.
- Use `birthdays` to list upcoming birthdays for the next week.
- **Greetings:**
- Use `hello` to receive a greeting from the bot.
- **Exit:**
- Use `close` or `exit` to terminate the program.### Error Handling
- Input errors (invalid formats, missing data) are gracefully handled with informative messages.
- Data validation ensures the integrity of contact information.### Testing
- Manually test the commands with various scenarios to ensure proper functionality and error handling.
- Consider adding automated tests for comprehensive coverage.### Conclusion
This enhanced address book demonstrates the practical application of object-oriented programming and data validation in Python. It provides a solid foundation for building more complex and interactive applications.