Skip to content

OlgaTsuban/Assistant_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Assistant bot

Here is the project "Assistant bot"

Why we have 4 files?

File main4.py has better functionality(I recommend you to use it), but others are working too.

Here is a description for each file.

main1.py

In the initial stage, our assistant bot is able to store a name and phone number, find a phone number by name, update a recorded phone number, and display all saved records in the console.

main2.py

Our assistant can already interact with the user using the command line, receiving commands and arguments and performing the required actions. In this program, we work on the internal logic of the assistant, focusing on how data is stored, what specific data is stored, and what can be done with it.

For these purposes, we apply object-oriented programming.

The user will have an address book or contact book. This contact book contains entries. Each entry contains a set of fields.

The user interacts with the contact book by adding, deleting, and editing entries. The user is also able to search for entries in the contact book using one or multiple criteria (fields).

Regarding fields, we can also say that they can be mandatory (such as name) and optional (such as phone or email). Entries can also contain multiple fields of the same type (multiple phone numbers, for example). The user has the ability to add/remove/edit fields in any entry.

main3.py

Here are the next upgrades:

  1. Add functionality for working with the Birthday field in the Record class, specifically the "days_to_birthday" function, which returns the number of days until the next birthday.
  2. Add validation functionality to ensure the correctness of provided values for the Phone and Birthday fields.
  3. Implement pagination (page-by-page output) for the AddressBook in cases where the book is very large and needs to be displayed in parts rather than all at once. Achieve this by creating an iterator for the entries.

main4.py

Here are the next upgrades:

  1. Add functionality to save the address book to disk and restore from disk.That allow you to save all data to a file and load them from a file.
  2. Provide the user with the ability to search through the content of the address book so that they can find all the information about one or several users based on digits of phone numbers, letters of names, etc.

What this project can do ?

This is a console assistant bot that recognizes commands entered from the keyboard and responds accordingly to the entered command. The assistant bot serves as a prototype for an assistant application. In its initial form, the assistant application is able to work with a contact book and a calendar.

The bot accepts the following commands:

  1. "hello ...": Responds in the console with "How can I help you?"
  2. "add ...": With this command, the bot stores a new contact in memory (e.g., in a dictionary). Instead of ..., the user enters a name and phone number, separated by a space.
  3. "change ...": This command allows the bot to update the phone number of an existing contact. Instead of ..., the user enters a name and the new phone number, separated by a space.
  4. "phone ...": Using this command, the bot displays the phone number of the specified contact in the console. Instead of ..., the user enters the name of the contact whose number they want to show.
  5. "show all": With this command, the bot displays all saved contacts with their phone numbers in the console.
  6. "good bye", "close", "exit": The bot terminates its operation after displaying "Good bye!" in the console, upon receiving any of these commands.
  7. From main2.py

  8. "delete ...": With this command, the bot deletes contact's number in memory (e.g., in a dictionary). Instead of ..., the user enters a name and phone number, separated by a space.
  9. From main3.py

  10. "birth ...": With this command, the bot stores a new contact in memory (or modify if it already exists). Instead of ..., the user enters a name and birthday, separated by a space.
  11. "days ...": Using this command, the bot displays the amount of days till birthday of the specified contact in the console. Instead of ..., the user enters the name of the contact .
  12. "iteration ...": Using this command, the bot displays the amount of phone number of the phone book in the console. Instead of ..., the user enters the number, how many contacts the user wants to see.
  13. From main4.py

  14. "search ...": Using this command, the bot displays the result of the search. Instead of ..., the user enters the string, what he/she wants to find.
  15. "get ...": Using this command, the bot get phone book from the file. Instead of ..., the user enters the name of the file, from what program needs to read the data.
  16. "send ...": Using this command, the bot send your phone book to the file. Instead of ..., the user enters the name of the file, to what program needs to write the data.
  17. How to use?

    You can write this for MacOS python3 main4.py

    You can write this for Windows python main4.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages