Professional Documents
Culture Documents
Project
Subject: Personal
assistant “Jarvis”
Team Member:
i) Shivam
ii) Udit
iii) Divya
Index
Introduction
Index
Certificate
Software and Hardware
Requirement
Source code in python
Output Screen
Explanation
Advantage
MySQL Table
Bibliography
Certificate
This is to certify that Udit Verma, the student of Class
XII-A has successfully completed the research on the
project “Jarvis: The personal assistant” of subject
‘Computer Science’ under the guidance of “Diksha
Khurrana” subject teacher of Computer science during
year 2022-23.
import sys
import wolframalpha
import pyttsx3
import tkinter
import json
import random
import operator
import speech_recognition as sr
import datetime
import wikipedia
import webbrowser
import os
import winshell
import pyjokes
import feedparser
import smtplib
import ctypes
import time
import requests
import shutil
import PIL.Image
import re
import os
import random
import pprint
import datetime
import requests
import sys
import urllib.parse
import pyjokes
import time
import pyautogui
import pywhatkit
import wolframalpha
import credentials as cr
import pymysql
import os
class login_page:
self.window = root
self.window.title("Log In PySeek")
self.window.geometry("1280x800+0+0")
self.window.config(bg = "white")
#============================================================================
#==============================DESIGN
PART===================================
#============================================================================
self.frame2.place(x=450,y=0,relwidth=1, relheight=1)
self.frame3.place(x=140,y=150,width=500,height=450)
self.password_label = Label(self.frame3,text="Password",
font=("helvetica",20,"bold"),bg="white", fg="gray").place(x=50,y=120)
#================Buttons===================
self.login_button = Button(self.frame3,text="Log
In",command=self.login_func,font=("times new roman",15,
"bold"),bd=0,cursor="hand2",bg="blue",fg="white").place(x=50,y=200,width=300)
self.forgotten_pass = Button(self.frame3,text="Forgotten
password?",command=self.forgot_func,font=("times new roman",10,
"bold"),bd=0,cursor="hand2",bg="white",fg="blue").place(x=125,y=260,width=150)
def login_func(self):
if self.email_entry.get()=="" or self.password_entry.get()=="":
else:
try:
connection=pymysql.connect(host=cr.host, user=cr.user,
password=cr.password, database=cr.database)
cur = connection.cursor()
row=cur.fetchone()
if row == None:
obj = JarvisAssistant()
# ================================ MEMORY
==============================================================================
=============================
EMAIL_DIC = {
'myself': 'freegameclaim@gmail.com',
#
==============================================================================
=========================================================================
def speak(text):
obj.tts(text)
app_id = "GU4J9A-2X9G3JXJJK"
def computational_intelligence(question):
try:
client = wolframalpha.Client(app_id)
answer = client.command(question)
answer = next(answer.results).text
print(answer)
return answer
except:
return None
def startup():
speak("Initializing Jarvis")
hour = int(datetime.datetime.now().hour)
speak("Good Morning")
speak("Good afternoon")
else:
speak("Good evening")
c_time = obj.tell_time()
speak(f"Currently it is {c_time}")
hour = int(datetime.datetime.now().hour)
else:
assname =("mansshiva")
speak(assname)
#def wish():
#hour = int(datetime.datetime.now().hour)
#speak("Good Morning")
# speak("Good afternoon")
#else:
#speak("Good evening")
#c_time = obj.tell_time()
#speak(f"Currently it is {c_time}")
# if __name__ == "__main__":
class MainThread(QThread):
def __init__(self):
super(MainThread, self).__init__()
def run(self):
self.TaskExecution()
def TaskExecution(self):
startup()
while True:
command = obj.mic_input()
if re.search('date', command):
date = obj.tell_me_date()
print(date)
speak(date)
elif "time" in command:
time_c = obj.tell_time()
print(time_c)
dict_app = {
'chrome': 'C:/Program
Files/Google/Chrome/Application/chrome'
path = dict_app.get(app)
if path is None:
else:
obj.launch_any_app(path_of_app=path)
speak(random.choice(GREETINGS_RES))
elif re.search('open', command):
open_result = obj.website_opener(domain)
print(open_result)
weather_res = obj.weather(city=city)
print(weather_res)
speak(weather_res)
if topic:
wiki_res = obj.tell_me(topic)
print(wiki_res)
speak(wiki_res)
else:
speak(
news_res = obj.news()
speak(articles['title'])
if index == len(news_res)-2:
break
obj.search_anything_google(command)
music_dir = "F://Songs//Imagine_Dragons"
songs = os.listdir(music_dir)
os.startfile(os.path.join(music_dir,
song))
pywhatkit.playonyt(video)
question = command
answer =
computational_intelligence(question)
speak(answer)
elif "what is" in command or "who is" in
command:
question = command
answer =
computational_intelligence(question)
speak(answer)
# obj.google_calendar_events(command)
note_text = obj.mic_input()
obj.take_note(note_text)
if "joke" in command:
joke = pyjokes.get_joke()
print(joke)
speak(joke)
elif "system" in command:
sys_info = obj.system_info()
print(sys_info)
speak(sys_info)
time.sleep(1)
try:
if city:
print(res)
speak(res)
else:
print(res)
speak(res)
except:
res = "Sorry sir, I couldn't get the
co-ordinates of the location you requested. Please try again"
speak(res)
ip =
requests.get('https://api.ipify.org').text
print(ip)
pyautogui.keyDown("alt")
pyautogui.press("tab")
time.sleep(1)
pyautogui.keyUp("alt")
try:
speak(
except Exception as e:
speak(
"Sorry sir, I coundn't fetch your
current location. Please try again")
name = obj.mic_input()
img = pyautogui.screenshot()
name = f"{name}.png"
img.save(name)
try:
img =
PIL.Image.open('D://JARVIS//JARVIS_2.0//' + name)
img.show(img)
speak("Here it is sir")
time.sleep(2)
except IOError:
os.system("attrib +h /s /d")
speak("Sir, all the files in this folder
are now hidden")
elif "visible" in command or "make files
visible" in command:
os.system("attrib -h /s /d")
# command = command
# answer =
computational_intelligence(command)
# speak(answer)
a = int(command())
time.sleep(a)
print(a)
wishMe()
speak("manshiva")
ctypes.windll.user32.SystemParametersInfoW(20,
0,
"Location of wallpaper",
0)
speak("manshiva")
sys.exit()
startExecution = MainThread()
class Main(QMainWindow):
def __init__(self):
super().__init__()
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.ui.start.clicked.connect(self.startTask)
self.ui.exit.clicked.connect(self.close)
def __del__(self):
sys.stdout = sys.__stdout__
# def run(self):
# self.TaskExection
def startTask(self):
self.ui.movie =
QtGui.QMovie("C://Users//prachi//Desktop//output folder//Comp-1_1.gif")
self.ui.label.setMovie(self.ui.movie)
self.ui.movie.start()
startExecution.start()
app = QApplication(sys.argv)
jarvis = Main()
jarvis.show()
exit(app.exec_())
except Exception as e:
messagebox.showerror("Error!",f"Error due to
{str(e)}",parent=self.window)
def forgot_func(self):
if self.email_entry.get()=="":
else:
try:
cur = connection.cursor()
row=cur.fetchone()
if row == None:
else:
connection.close()
#=========================SECOND
WINDOW===============================
self.root=Toplevel()
self.root.title("Forget Password?")
self.root.geometry("400x440+450+200")
self.root.config(bg="white")
self.root.focus_force()
self.root.grab_set()
self.sec_ques.place(x=10,y=120, width=270)
self.sec_ques.current(0)
self.ans = Entry(self.root,font=("arial"))
self.ans.place(x=10,y=195,width=270)
self.new_pass.place(x=10,y=270,width=270)
self.create_button =
Button(self.root,text="Submit",command=self.change_pass,font=("times new
roman",18,
"bold"),bd=0,cursor="hand2",bg="green2",fg="white").place(x=95,y=340,width=200
)
#=========================================================================
except Exception as e:
messagebox.showerror("Error", f"{e}")
def change_pass(self):
else:
try:
cur = connection.cursor()
row=cur.fetchone()
if row == None:
try:
connection.commit()
connection.close()
self.reset_fields()
self.root.destroy()
messagebox.showerror("Error!", f"{er}")
messagebox.showerror("Error!", f"{er}")
def redirect_window(self):
self.window.destroy()
root = Tk()
obj = SignUp(root)
root.mainloop()
def reset_fields(self):
self.email_entry.delete(0,END)
self.password_entry.delete(0,END)
if __name__ == "__main__":
root = Tk()
obj = login_page(root)
root.mainloop()
Output Screen
Explanation
Do you remember J.A.R.V.I.S., Tony Stark's virtual
personal assistant? If you've seen any of the
Ironman or Avengers movies, I'm sure you do.
Have you ever wondered whether you could
create your own personal assistant? Yes?
We have created one for you by utilising our time
in python.
We have different function as per your need and
we have linked it to web like:
i. If you say play music it will play a music for
your music folder
ii. If you say YouTube it will open YouTube in
your chrome
iii. If you say tell me about a person he will
Wikipedia that person tell top line on
Wikipedia
iv. If you say calculate a sum it will calculate it and
tell answer
v. If you say show me screenshot then he will
show screenshot from screenshot folder
Advantage
Chances are we have all heard about or maybe even used voice assistant
technology in one form or another. Leading tech-giants have all launched
products that support voice technology. Some examples include Google’s
Assistant, Amazon’s Alexa, Microsoft’s Cortana, and, of course, Apple’s
Siri.
In the past few years, more companies have been exploring personal
voice assistant technology for app development and tech-business.
Encompassing the advantages, this has translated into an increase in
usage and awareness from consumers. Global auditing company PwC, in
recent research, states that from the 1000 consumers (aged 18–64)
questioned, the knowledge about voice technology was at 90% of the
subjects, and a majority (72%) had also used a voice assistant.
More business owners need to consider the various benefits they can
derive from the advantages of voice-activated personal assistant I will be
discussing below.
Enhances e-Commerce Marketing
Consumers request for round the clock support. Sometimes there are
instances when they require assistance at odd hours, and when help isn’t
available, it becomes a frustrating experience. To avoid such situations,
voice assistants come in handy. A digital talking assistant does not require
any off days or sick leaves that interrupt customer care and experiences.
Take, for instance, if you run a hotel using voice assistant technology, if a
guest gets too cold or warm at night, rather than call the front desk or
fiddle with instruments, the guest can make use of the in-room smart
speaker. Therefore, you eliminate the need for night support staff
because you are covered with personal assistant technology, and your
24/7 customer support is guaranteed.
Eradicates Language Barriers
You can make use of Alexa Skills and Google Actions to facilitate specific
actions for your customers. Artificial intelligence assistant technology
helps your business to streamline day-to-day operations that are always
being supervised. Things such as remembering important dates,
deadlines, booking appointments, scheduling, etc. can be all triggered
using specific voice commands.
Voice assistants also allow the creation of smart and connected offices. If
a voice-activated personal assistant knows that a particular part of the
office space will not be in use, it can connect with smart office solutions
to turn off the lights and other utilities until the area is needed. You can
do this by simply setting up a smart thermostat to your voice assistant
and tell it when you’re leaving the office so that your heating and lights
get turned off. Also, office and business resources can be ordered using
simple voice commands and likewise set to give alerts when supplies are
running low.
Conclusion
One thing is for sure. Personal voice assistance technology is here to stay.
Just the simple thought of talking to a device to get some tasks done is an
appealing innovation that presents multiple opportunities, most notably
for businesses. The voice talking technology is poised to continue to shift
consumer behaviour, and it, if necessary, for businesses to prepare to
meet consumer needs. Getting into the voice technology space today is
bound to make a huge difference and give your brand an edge in a highly
competitive market.
one. Submit your query here and we will connect you with the right
chatbot experts. He might be sitting next door, you never know.
Bio