0% found this document useful (0 votes)
6 views23 pages

Surya Nsh

The document outlines a project titled 'Jarvis AI Smart Desktop' completed by a Class 12 student at Jyoti Senior Secondary School for the Informatics Practices course. It details the project’s objectives, the programming language Python, its applications, and the MySQL database system. Additionally, it includes the necessary hardware and software requirements, along with a sample code for the Jarvis program that utilizes speech recognition and various Python libraries.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views23 pages

Surya Nsh

The document outlines a project titled 'Jarvis AI Smart Desktop' completed by a Class 12 student at Jyoti Senior Secondary School for the Informatics Practices course. It details the project’s objectives, the programming language Python, its applications, and the MySQL database system. Additionally, it includes the necessary hardware and software requirements, along with a sample code for the Jarvis program that utilizes speech recognition and various Python libraries.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Second

r a
io r
n

y
Jyoti Se

Sch l
oo
2024 - 2025

Topic:

Submitted To: Submitted By:


Mr. Rajesh Dubey
Class:
Section:
Roll Number:
I, ____________________, a student of Class 12th '____________' at Jyoti
Senior Secondary School, Rewa, hereby declare that I have completed
the project titled "_______________________________" for Informatics
Practices (IP).
This project is the result of my efforts, research, and exploration. I
extend my gratitude to my IP teacher, Mr. Rajesh Dubey, for his
guidance and support.
The project was completed during the academic year 2024-25 as part of
the CBSE Practical Examination. All work presented is original and for
academic purposes.
This is to certify that _______________________, a student
of Class 12th '__________' (__________________) at Jyoti
Senior Secondary School, Rewa, has successfully
completed the project titled
"___________________________________" during the academic
year 2024-25 under the guidance of Mr. Rajesh Dubey, IP
teacher.
The project meets the requirements of the CBSE
Practical Examination and reflects a satisfactory
understanding of the topic.

Teacher Incharge

Internal Examinar External Examinar


I would like to express my gratitude to everyone who contributed to
the successful completion of my project titled
"__________________________________".
Special thanks to Mr. Rajesh Dubey, my Informatics Practices
teacher, for his guidance and support. I am also thankful to Jyoti
Senior Secondary School, Rewa, for providing the necessary
resources and environment.
Finally, I appreciate my family and friends for their constant
motivation. This project has been an enriching learning experience,
and I’m grateful for the opportunity to explore.
IP INVESTIGATORY
PROJECTON JARVIS AI SMART DESKTOP
Python is a powerful general-purpose programming language. It is used in web development,
data science, creating software prototypes, and so on. Fortunately for beginners, Python has
simple easy-to-use syntax. This makes Python an excellent language to learn to program for
beginners.
Python is a general-purpose interpreted, interactive, object-oriented, and high-level
programming language. It was created by Guido van Rossum during 1985- 1990. Like Perl,
Python source code is also available under the GNU General Public License (GPL).

Why to Learn Python?


Python is a high-level, interpreted, interactive and object-oriented scripting language.
Python is designed to be highly readable. It uses English keywords frequently where as other
languages use punctuation, and it has fewer syntactical constructions than other languages.
Python is a MUST for students and working professionals to become a great Software
Engineer specially when they are working in Web Development Domain. I will list down some
of the key advantages of learning Python:
 Python is Interpreted − Python is processed at runtime by the interpreter. You do not
need to compile your program before executing it. This is similar to PERL and PHP.
 Python is Interactive − You can actually sit at a Python prompt and interact with the
interpreter directly to write your programs.
 Python is Object-Oriented − Python supports Object-Oriented style or technique of
programming that encapsulates code within objects.
 Python is a Beginner's Language − Python is a great language for the beginner-level
programmers and supports the development of a wide range of applications from
simple text processing to WWW browsers to games.

Characteristics of Python
Following are important characteristics of Python Programming −
 It supports functional and structured programming methods as well as OOP.
 It can be used as a scripting language or can be compiled to byte-code for building large
applications.
 It provides very high-level dynamic data types and supports dynamic type checking.
 It supports automatic garbage collection.
 It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.
IP INVESTIGATORY
PROJECTON JARVIS AI SMART DESKTOP
Hello World using Python.
Just to give you a little excitement about Python, I'm going to give you a small conventional
Python Hello World program, You can try it using Demo link.
Live Demo
print ("Hello, Python!");

Applications of Python
As mentioned before, Python is one of the most widely used language over the web. I'm going
to list few of them here:
 Easy-to-learn − Python has few keywords, simple structure, and a clearly defined
syntax. This allows the student to pick up the language quickly.
 Easy-to-read − Python code is more clearly defined and visible to the eyes.
 Easy-to-maintain − Python's source code is fairly easy-to-maintain.
 A broad standard library − Python's bulk of the library is very portable and cross-
platform compatible on UNIX, Windows, and Macintosh.
 Interactive Mode − Python has support for an interactive mode which allows
interactive testing and debugging of snippets of code.
 Portable − Python can run on a wide variety of hardware platforms and has the same
interface on all platforms.
 Extendable − You can add low-level modules to the Python interpreter. These modules
enable programmers to add to or customize their tools to be more efficient.
 Databases − Python provides interfaces to all major commercial databases.
 GUI Programming − Python supports GUI applications that can be created and ported
to many system calls, libraries and windows systems, such as Windows MFC,
Macintosh, and the X Window system of Unix.
 Scalable − Python provides a better structure and support for large programs than
shell scripting.
IP INVESTIGATORY
PROJECTON JARVIS AI SMART DESKTOP
What is a Database?
A database is a separate application that stores a collection of data. Each database has one
or more distinct APIs for creating, accessing, managing, searching and replicating the data it
holds.
Other kinds of data stores can also be used, such as files on the file system or large hash
tables in memory but data fetching and writing would not be so fast and easy with those type
of systems.
Nowadays, we use relational database management systems (RDBMS) to store and manage
huge volume of data. This is called relational database because all the data is stored into
different tables and relations are established using primary keys or other keys known as
Foreign Keys.
A Relational DataBase Management System (RDBMS) is a software that −
 Enables you to implement a database with tables, columns and indexes.
 Guarantees the Referential Integrity between rows of various tables.
 Updates the indexes automatically.
 Interprets an SQL query and combines information from various tables.

RDBMS Terminology
Before we proceed to explain the MySQL database system, let us revise a few definitions
related to the database.
 Database − A database is a collection of tables, with related data.
 Table − A table is a matrix with data. A table in a database looks like a simple
spreadsheet.
 Column − One column (data element) contains data of one and the same kind, for
example the column postcode.
 Row − A row (= tuple, entry or record) is a group of related data, for example the data
of one subscription.
 Redundancy − Storing data twice, redundantly to make the system faster.
 Primary Key − A primary key is unique. A key value can not occur twice in one table.
With a key, you can only find one row.
 Foreign Key − A foreign key is the linking pin between two tables.
IP INVESTIGATORY
PROJECTON JARVIS AI SMART DESKTOP
 Compound Key − A compound key (composite key) is a key that consists of multiple
columns, because one column is not sufficiently unique.
 Index − An index in a database resembles an index at the back of a book.
 Referential Integrity − Referential Integrity makes sure that a foreign key value always
points to an existing row.

MySQL Database
MySQL is a fast, easy-to-use RDBMS being used for many small and big businesses. MySQL is
developed, marketed and supported by MySQL AB, which is a Swedish company. MySQL is
becoming so popular because of many good reasons −
 MySQL is released under an open-source license. So you have nothing to pay to use it.
 MySQL is a very powerful program in its own right. It handles a large subset of the
functionality of the most expensive and powerful database packages.
 MySQL uses a standard form of the well-known SQL data language.
 MySQL works on many operating systems and with many languages including PHP,
PERL, C, C++, JAVA, etc.
 MySQL works very quickly and works well even with large data sets.
 MySQL is very friendly to PHP, the most appreciated language for web development.
 MySQL supports large databases, up to 50 million rows or more in a table. The default
file size limit for a table is 4GB, but you can increase this (if your operating system can
handle it) to a theoretical limit of 8 million terabytes (TB).
 MySQL is customizable. The open-source GPL license allows programmers to modify
the MySQL software to fit their own specific environments.
IP INVESTIGATORY
PROJECTON JARVIS AI SMART DESKTOP

HARDWARE REQUIREMENTS:- EARPHONE OR HEADPHONE WITH MIC TO


GIVE COMMAND TO JARVIS, EXTERNAL SPEAKER to HEAR THE JARVIS
SOUND

SOFTWARE REQUIREMENTS:-PYTHON 3.7 AND USE PYCHARM OR VISUAL


STUDIO CODE FOR BEST INTERFACE

MODULES YOU NEED TO INSTALL FOR THIS PROGRAM


 PIP INSTALL PYAUDIO
 PIP INSTALL SPEECH RECOGNITION
 PIP INSTALL pygame
 PIP INSTALL WEBBROWSER
 PIP INSTALL WIKIPEDIA
 PIP INSTALL PYTTSX3
 PIP INSTALL WolframAlpha
IP INVESTIGATORY
PROJECTON JARVIS AI SMART DESKTOP

DEBUGGING

ERROR WHILE INSTALLING PIP INSTALL PYAUDIO AND HOW TO FIX IT

TYPE ON CMDpip install - -upgrade setuptools


THEN AGAIN TYPE:

pip install pipwin

pipwin install pyaudio

#JARVIS PROGRAM 1
import pyaudio
import speech_recognition as sr
from pygame import mixer
import os
import random
import socket
import webbrowser
import subprocess
import glob
IP INVESTIGATORY
PROJECTON JARVIS AI SMART DESKTOP
from time import localtime, strftime
import speekmodule

doss = os.getcwd()
i=0
n=0

INFO = '''
+=======================================+
|.....JARVISE VIRTUAL INTELLIGENCE......|
+---------------------------------------+
|#Author:Aditya singh |
|#Date: 15/09/2019 |
|#Changing the Description of this tool |
| Won't made you the coder |
|#EAT CODE SLEEP REPEAT |
+---------------------------------------+
|.....JARVISE VIRTUAL INTELLIGENCE......|
+=======================================+
| OPTIONS: |
|#hello/hi #goodbye #sleep mode |
|#your name #jarvis #what time |
|#asite.com #next music #music |
|#pause music #wifi #thank you |
|#start/stop someapp |
|#pip install/uninstall anapp |
|#googlemaps tanyplace |
+=======================================+
IP INVESTIGATORY
PROJECTON JARVIS AI SMART DESKTOP
'''
print(INFO)
# JARVIS'S
EARS======================================================================
==================================== SENSITIVE BRAIN
# obtain audio
while (i<1):
r = sr.Recognizer()
with sr.Microphone() as source:
audio = r.adjust_for_ambient_noise(source)
n=(n+1)
print("Say something!")
audio = r.listen(source)
# interprete audio (Google Speech Recognition)
try:
s = (r.recognize_google(audio))
message = (s.lower())
print (message)

# POLITE JARVIS
===========================================================================
================================== BRAIN 1

if ('goodbye') in message:
rand = ['Goodbye Sir', 'Jarvis powering off in 3, 2, 1, 0']
speekmodule.speek(rand,n,mixer)
break
IP INVESTIGATORY
PROJECTON JARVIS AI SMART DESKTOP
if ('hello') in message or ('hi') in message:
rand = ['Wellcome to Jarvis virtual intelligence project. At your service sir.']
speekmodule.speek(rand,n,mixer)

if ('thanks') in message or ('tanks') in message or ('thank you') in message:


rand = ['You are wellcome', 'no problem']
speekmodule.speek(rand,n,mixer)

if message == ('jarvis'):
rand = ['Yes Sir?', 'What can I doo for you sir?']
speekmodule.speek(rand,n,mixer)

if ('how are you') in message or ('and you') in message or ('are you okay') in message:
rand = ['Fine thank you']
speekmodule.speek(rand,n,mixer)

if ('*') in message:
rand = ['Be polite please']
speekmodule.speek(rand,n,mixer)

if ('your name') in message:


rand = ['My name is Jarvis, at your service sir']
speekmodule.speek(rand,n,mixer)

# USEFUL JARVIS
===========================================================================
================================== BRAIN 2

if ('wi-fi') in message:
IP INVESTIGATORY
PROJECTON JARVIS AI SMART DESKTOP
REMOTE_SERVER = "www.google.com"
speekmodule.wifi()
rand = ['We are connected']
speekmodule.speek(rand,n,mixer)

if ('.com') in message :
rand = ['Opening' + message]
Chrome = ("C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s")
speekmodule.speek(rand,n,mixer)
webbrowser.get(Chrome).open('http://www.'+message)
print ('')

if ('google maps') in message:


query = message
stopwords = ['google', 'maps']
querywords = query.split()
resultwords = [word for word in querywords if word.lower() not in stopwords]
result = ''.join(resultwords)
Chrome = ("C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s")
webbrowser.get(Chrome).open("https://www.google.be/maps/place/"+result+"/")
rand = [result+'on google maps']
speekmodule.speek(rand,n,mixer)

if message != ('start music') and ('start') in message:


query = message
stopwords = ['start']
querywords = query.split()
IP INVESTIGATORY
PROJECTON JARVIS AI SMART DESKTOP
resultwords = [word for word in querywords if word.lower() not in stopwords]
result = ''.join(resultwords)
os.system('start ' + result)
rand = [('starting '+result)]
speekmodule.speek(rand,n,mixer)

if message != ('stop music') and ('stop') in message:


query = message
stopwords = ['stop']
querywords = query.split()
resultwords = [word for word in querywords if word.lower() not in stopwords]
result = ''.join(resultwords)
os.system('taskkill /im ' + result + '.exe /f')
rand = [('stopping '+result)]
speekmodule.speek(rand,n,mixer)

if ('install') in message:
query = message
stopwords = ['install']
querywords = query.split()
resultwords = [word for word in querywords if word.lower() not in stopwords]
result = ''.join(resultwords)
rand = [('installing '+result)]
speekmodule.speek(rand,n,mixer)
os.system('python -m pip install ' + result)

if ('sleep mode') in message:


IP INVESTIGATORY
PROJECTON JARVIS AI SMART DESKTOP
rand = ['good night']
speekmodule.speek(rand,n,mixer)
os.system('rundll32.exe powrprof.dll,SetSuspendState 0,1,0')

if ('music') in message:
mus = random.choice(glob.glob(doss + "\\music" + "\\*.mp3"))
os.system('chown -R user-id:group-id mus')
os.system('start ' + mus)
rand = ['start playing']
speekmodule.speek(rand,n,mixer)

if ('what time') in message:


tim = strftime("%X", localtime())
rand = [tim]
speekmodule.speek(rand,n,mixer)

# exceptions
except sr.UnknownValueError:
print("$could not understand audio")
except sr.RequestError as e:
print("Could not request results$; {0}".format(e))
IP INVESTIGATORY
PROJECTON JARVIS AI SMART DESKTOP

#JARVIS PROGRAM 2
import pyttsx3
import webbrowser
import smtplib
import random
import speech_recognition as sr
import wikipedia
import datetime
import wolframalpha
import os
import sys

engine = pyttsx3.init('sapi5')

client = wolframalpha.Client('QAEXLK-RY9HY2PHAT')

voices = engine.getProperty('voices')
engine.setProperty('voice', voices[len(voices)-1].id)

def speak(audio):
print('Computer: ' + audio)
IP INVESTIGATORY
PROJECTON JARVIS AI SMART DESKTOP
engine.say(audio)
engine.runAndWait()

def greetMe():
currentH = int(datetime.datetime.now().hour)
if currentH >= 0 and currentH < 12:
speak('Good Morning!')

if currentH >= 12 and currentH < 18:


speak('Good Afternoon!')

if currentH >= 18 and currentH !=0:


speak('Good Evening!')

greetMe()

speak('Hello hacker, I am your personal assistant!')


speak('How may I help you?')

def myCommand():

r = sr.Recognizer()
with sr.Microphone() as source:
print("Listening...")
r.pause_threshold = 1
audio = r.listen(source)
try:
IP INVESTIGATORY
PROJECTON JARVIS AI SMART DESKTOP
query = r.recognize_google(audio, language='en-in')
print('User: ' + query + '\n')

except sr.UnknownValueError:
speak('Sorry aditya! I didn\'t get that! Try typing the command!')
query = str(input('Command: '))

return query

if __name__ == '__main__':

while True:

query = myCommand();
query = query.lower()

if 'open youtube' in query:


speak('okay')
webbrowser.open('www.youtube.com')

elif 'open google' in query:


speak('okay')
webbrowser.open('www.google.co.in')

elif 'open gmail' in query:


speak('okay')
webbrowser.open('www.gmail.com')
IP INVESTIGATORY
PROJECTON JARVIS AI SMART DESKTOP
elif "what\'s up" in query or 'how are you' in query:
stMsgs = ['Just doing my thing!', 'I am fine!', 'Nice!', 'I am nice and full of energy']
speak(random.choice(stMsgs))

elif 'email' in query:


speak('Who is the sender? ')
sender = myCommand()

if 'I am' in sender:


try:
speak("Please Enter Email address of Recipient.")
Recipient_user = input("User: ")
speak('What should I say? ')
content = myCommand()

server = smtplib.SMTP('smtp.gmail.com', 587)


server.ehlo()
server.starttls()
server.login("[email protected]", 'YOURPASSWORD')
server.sendmail('[email protected]', Recipient_user, content)
server.close()
speak('Email sent!')

except:
speak('Sorry aditya! I am unable to send your message at this moment!')

elif 'nothing' in query or 'abort' in query or 'stop' in query:


IP INVESTIGATORY
PROJECTON JARVIS AI SMART DESKTOP
speak('okay')
speak('Bye aditya, have a good day.')
sys.exit()

elif 'hello' in query:


speak('Hello aditya')

elif 'bye' in query:


speak('Bye aditya, have a good day.')
sys.exit()

elif 'play music' in query:


music_folder = 'D:\\jarvis music'
music = [music1, music2, music3, music4, music5]
random_music = music_folder + random.choice(music) + '.mp3'
os.system(random_music)

speak('Okay, here is your music! Enjoy!')

else:
query = query
speak('Searching...')
try:
try:
res = client.query(query)
results = next(res.results).text
speak('WOLFRAM-ALPHA says - ')
IP INVESTIGATORY
PROJECTON JARVIS AI SMART DESKTOP
speak('Got it.')
speak(results)

except:
results = wikipedia.summary(query, sentences=2)
speak('Got it.')
speak('WIKIPEDIA says - ')
speak(results)

except:
webbrowser.open('www.google.com')

speak('Next Command! Aditya!')


STACKOVERFLOW
SUMITA ARORA 12TH BOOK

You might also like