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
orexit
commands to properly terminate the program.
- Handles
- Install Python 3.x if you haven't already.
- Download the provided code files.
- Open a terminal or command prompt.
- Navigate to the directory containing the code files.
- Run the program using
python main.py
. - Follow the prompts and commands to interact with the address book.
- Add Contacts:
- Use
add [name] [phone]
to add a new contact or update an existing one.
- Use
- Change Phone Number:
- Use
change [name] [old_phone] [new_phone]
to modify a contact's phone number.
- Use
- Display Contacts:
- Use
phone [name]
to show a contact's phone numbers. - Use
all
to display all contacts in the address book.
- Use
- 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.
- Use
- Greetings:
- Use
hello
to receive a greeting from the bot.
- Use
- Exit:
- Use
close
orexit
to terminate the program.
- Use
- Input errors (invalid formats, missing data) are gracefully handled with informative messages.
- Data validation ensures the integrity of contact information.
- Manually test the commands with various scenarios to ensure proper functionality and error handling.
- Consider adding automated tests for comprehensive coverage.
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.