Jarvis Personal assistant using Python

Published on . Written by

Jarvis Personal assistant using Python

We are all admirers of the Marvel series and especially Tony Stark’s assistant J.A.R.V.I.S. The full form of J.A.R.V.I.S. i.e. “Just A Rather Very Intelligent System” is also very appropriate and fit for all he does for Tony. We have all dreamt of having one JARVIS for our whole lives. So, why not start by building one elementary JARVIS ourselves. Though the real JARVIS is built with AI technologies, here in this python project we will simply code it with some basic knowledge and skills of Python.


Skyfi Labs Projects
Let me tell you about all the features our JARVIS will possess. It will wish you according to the time and it will hear your basic commands such as searching or opening a window on the web browser, for example, YouTube, Google, Reddit, etc. You can also code it in a way enabling it to send emails for you. 

Read more..

SLNOTE
Knowledge required: Basic Python concepts

Kit required: An IDE


SLLATEST
Libraries imported: pyttsx3, speech-recognition, DateTime, Wikipedia, web browser, OS, and smtplib. 

Note that you can visit the documentation of the modules of all the libraries mentioned above on the web. The implementation of the libraries and the functions are perfectly described there. 

  1. Start by creating a new file on your IDE and it is suggested that you open the terminal with the editor so that you can keep running the program while you update it.
  2. Import all the libraries mentioned above.
  3. We will start by printing/speaking “initializing JARVIS…”. For this create a new function called speak which will pronounce the string passed to it.
  4. You can add strings such as, “I am JARVIS, how may I help you?”.
  5. Further, we will create some more functions to add more features to our JARVIS.
  6. Start by creating a Wish me a function which will wish you according to the time of the day. Here the DateTime library will come into use.
  7. Once you know the use of the library from the module, set the time bounds such that it wishes you Good morning, Good afternoon and Good evening accordingly.
  8. Coming to the main feature of JARVIS, we will create a new function called Take Command. This function will take your voice command via your source microphone, recognize it, and then JARVIS will respond to it.
  9. To take input from the microphone use the speech recognition module and a class called recognizer.
  10. Use the google engine to recognize the audio given to the microphone.
  11. Now develop logic in your function, such that whenever if a particular keyword is recognized, JARVIS gets into those if and elif statements and act as coded.
  12. For suppose if your query contains “Wikipedia” then JARVIS extracts two sentences from Wikipedia on whatever you asked to search. And then print and speak the results.
  13. Similarly, if your query contains “Play Music” then add the music path in your code and JARVIS will play it.
  14. Next, to open a new window of google, YouTube, or Reddit, the web browser library comes into play.
  15. Last but not the least, to send automated emails, go through the smtplib module which will help you to code your JARVIS in a way that sends automated emails.

SLDYK
Kit required to develop Jarvis Personal assistant using Python:
Technologies you will learn by working on Jarvis Personal assistant using Python:


Any Questions?


Subscribe for more project ideas