Skip to content

Commit

Permalink
V-0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Hashah2311 committed Apr 26, 2022
1 parent 019322d commit b9f68f1
Show file tree
Hide file tree
Showing 23 changed files with 116 additions and 88 deletions.
45 changes: 23 additions & 22 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,24 @@
#### You dont need to install python to run this assistant. You can use the env. But if you want to, than install python 3, as this project is made with python 3.
## Features
### This assistant currently have following features:-
- 1)Wish the user!
- 2)Introduce itself
- 3)Search wikipedia
- 4)Play songs
- 5)Open Google
- 6)Email to someone
- 7)Tell time
- 8)Tell weather
- 9)Search on google
- 10)Search on youtube
- 11)Get jokes
- 12)Get news
- 13)Give advice
- 14)Get your ip
- 15)Exit itself
- 16)Unmute mic (Zoom/Teams)
- 17)Check For Updates
- 18)Calculate anything
1. Wish the user!
2. Introduce itself
3. Search wikipedia
4. Play songs
5. Open Google
6. Email to someone
7. Tell time
8. Tell weather
9. Search on google
10. Search on youtube
11. Get jokes
12. Get news
13. Give advice
14. Get your ip
15. Exit itself
16. Unmute mic (Zoom/Teams)
17. Check For Updates
18. Calculate anything
## Code Structure


Expand All @@ -70,14 +70,15 @@
│ ├── process.py # Process Checking Script
│ └── speak_f.py # Speak Function File
├── .gitattributes # gitattributes File
├── .gitignore # gitignore File
├── token.py # Token File
├── Main.py # Main JARVIS File
├── PyAudio-0.2.11-cp310-cp310-win_amd64.whl # Wheel File For PyAudio Package
├── functions.py # Functions
├── requirements.py # Automatically Installs Dependencies
├── __init__.py # Starting File
├── run.cmd # Command Prompt Script To Run The Program
└── run.ps1 # Powershell Script To Run The Program

## Editions
#### Please see [Editions.txt](Editions.txt) file
#### Please see [Editions.txt](.github/Editions.txt) file
## Extras
#### If you have any issues, you can post it in the issues page and I will try to solve it ASAP. If you are interested to know more about the code,etc. you can mail me on "[email protected]". Thank you I will close for now, I am also working on the tutorial video so stay tuned!
#### If you have any issues, you can post it in the issues page and I will try to solve it ASAP. If you are interested to know more about the code,etc. you can mail me on "[email protected]". Thank you I will close for now, I am also working on the tutorial video so stay tuned!
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
token.py
42 changes: 18 additions & 24 deletions Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,28 +126,22 @@
speak("Found! Opening On google.")
webbrowser.open(google)

except KeyboardInterrupt:
import os
os.system("cls")
print("Assistant exited manually. Exiting JARVIS.")
exit()
except Exception as error:
if 'Keyboard Interrupt' in error:
print("Assistant exited manually. Exiting JARVIS.")
exit()
else:
print("An error occured while running the code. Submitting the error to Github and restarting....")
file = open("Error.main.py.log", "a")
file.write(str(error))
file.close()
try:
import requests
import json
import os
#headers = {f"Authorization" : "token {token}"}
data = {"title": "JARVIS Error Reporting System Reported An Error"}
label = {"labels": ["Error"]}
body = {"body": [error]}
url = "https://api.github.com/repos/Hashah2311/JARVIS/issues"
#requests.post(url,data=json.dumps(data,label,body),headers=headers)
requests.post(url,data=json.dumps(data,label,body))
os.system("run.cmd")
#exit()
except:
print("Critical Crash!")
exit()
import os
os.system("cls")
print("An error occured while running the code. Submitting the error to Github....")
import token
tok = token.token
e = str(error)
import requests
import json
headers = {"Authorization" : "token {}".format(tok)}
data2 = {"title": "JARVIS Error Reporting System Reported An Error", "labels": ["Error"], "body": (e)}
url = "https://api.github.com/repos/Hashah2311/JARVIS/issues"
requests.post(url,data=json.dumps(data2),headers=headers)
exit()
31 changes: 31 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
try:
import os
os.system("cls")
print("checking if dependencies are installed")
env = "env\python.exe"
os.system(f"{env} -m pip install bs4 datetime pipwin psutil pyautogui pyfiglet pypiwin32 requests speechRecognition wheel Wikipedia wolframalpha")
os.system(f"{env} -m pip uninstall pyttsx")
os.system(f"{env} -m pip install git+https://github.com/jpercent/pyttsx.git")
os.system(f"{env} -m pipwin install pocketsphinx")
os.system(f"{env} -m pipwin install Pyaudio")
#Starting the app
os.system(f"{env} Main.py")
except KeyboardInterrupt:
import os
os.system("cls")
print("Assistant exited manually. Exiting JARVIS.")
exit()
except Exception as error:
import os
os.system("cls")
print("An error occured while running the code. Submitting the error to Github....")
import token
tok = token.token
e = str(error)
import requests
import json
headers = {"Authorization" : "token {}".format(tok)}
data2 = {"title": "JARVIS Error Reporting System Reported An Error", "labels": ["Error"], "body": (e)}
url = "https://api.github.com/repos/Hashah2311/JARVIS/issues"
requests.post(url,data=json.dumps(data2),headers=headers)
exit()
Binary file modified __pycache__/functions.cpython-310.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion env/Lib/site-packages/PyAudio-0.2.11.dist-info/RECORD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PyAudio-0.2.11.dist-info/METADATA,sha256=snj42ivuWKkN4gsGDfZppeJA8Ddn3qCvqRa_yDl
PyAudio-0.2.11.dist-info/RECORD,,
PyAudio-0.2.11.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
PyAudio-0.2.11.dist-info/WHEEL,sha256=W26pYN7HLsBT1jrDSL9udgf_mdNKJmYmL23sIP-FcgM,102
PyAudio-0.2.11.dist-info/direct_url.json,sha256=A_EhTJKaqe09gH4U1NYu4CZbhqT26MV_jCmTzIRXjSw,89
PyAudio-0.2.11.dist-info/direct_url.json,sha256=4n_vPk4oomx3ZN6dkmozFq_aEMU5UlF_bBgfyam4YGU,110
PyAudio-0.2.11.dist-info/top_level.txt,sha256=byFCF4ZeZ_RFXNUXpPqEnFej1lo1hzAwqlj3B6vLvPk,19
__pycache__/pyaudio.cpython-310.pyc,,
_portaudio.cp310-win_amd64.pyd,sha256=d1OND65loTnljOO7CdpHJnD5VFb7HqviAikHsfY97t0,209408
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"archive_info": {}, "url": "file:///D:/JARVIS/PyAudio-0.2.11-cp310-cp310-win_amd64.whl"}
{"archive_info": {}, "url": "file:///C:/Users/Harshit%20Shah/pipwin/PyAudio-0.2.11-cp310-cp310-win_amd64.whl"}
Binary file modified env/Lib/site-packages/__pycache__/pyaudio.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file modified env/Lib/site-packages/pyttsx/__pycache__/driver.cpython-310.pyc
Binary file not shown.
Binary file modified env/Lib/site-packages/pyttsx/__pycache__/engine.cpython-310.pyc
Binary file not shown.
Binary file modified env/Lib/site-packages/pyttsx/__pycache__/voice.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added env/Scripts/__pycache__/token.cpython-310.pyc
Binary file not shown.
71 changes: 39 additions & 32 deletions functions.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
try:
version = "V-0.3.5"
version = "V-0.4.0"
mail = 'YOUR MAIL ID'
password = 'YOUR MAIL PASSWORD(DONT WORRY)'
nversion = "V-beta-4"
nversion = "V-beta-4.5"
import time
import sys
import os
Expand All @@ -21,14 +21,14 @@
import pyaudio
import pyfiglet

engine = pyttsx.init('sapi5')
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[1].id)

def speak(audio):
engine = pyttsx.init('sapi5')
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[1].id)
print(audio)
engine.say(audio)
engine.runAndWait()

def wishMe():
hour = int(datetime.datetime.now().hour)
if hour>=6 and hour<12:
Expand Down Expand Up @@ -67,14 +67,26 @@ def sendEmail(to, content):

def intro():
speak("Hello Sir or Mam! I am JARVIS. nice to meet you!")

def animation():
#A = "[----------]"
#B = "[#---------]"
#C = "[##--------]"
#D = "[###-------]"
#E = "[####------]"
#F = "[#####-----]"
#G = "[######----]"
#H = "[#######---]"
#I = "[########--]"
#J = "[#########-]"
#K = "[##########]"
os.system("cls")
load_str = "STARTING JARVIS..."
load_str = "STARTING JARVIS"
ls_len = len(load_str)
print(version)

animation = "|/-\\"
#animation = A,B,C,D,E,F,G,H,I,J,K
anicount = 0

counttime = 0
Expand Down Expand Up @@ -167,28 +179,23 @@ def calculate(question):
speak(answer)
except:
speak("Sorry sir, I couldn't fetch your question's answer. Please try again.")

except KeyboardInterrupt:
import os
os.system("cls")
print("Assistant exited manually. Exiting JARVIS.")
exit()
except Exception as error:
if 'Keyboard Interrupt' in error:
print("Assistant exited manually. Exiting JARVIS.")
exit()
else:
print("An error occured while running the code. Submitting the error to Github and restarting....")
file = open("Error.functions.py.log", "a")
file.write(str(error))
file.close()
try:
import requests
import json
import os
#headers = {f"Authorization" : "token {token}"}
data = {"title": "JARVIS Error Reporting System Reported An Error"}
label = {"labels": ["Error"]}
body = {"body": [error]}
url = "https://api.github.com/repos/Hashah2311/JARVIS/issues"
#requests.post(url,data=json.dumps(data,label,body),headers=headers)
requests.post(url,data=json.dumps(data,label,body))
os.system("run.cmd")
#exit()
except:
print("Critical Crash!")
exit()
import os
os.system("cls")
print("An error occured while running the code. Submitting the error to Github....")
import token
tok = token.token
e = str(error)
import requests
import json
headers = {"Authorization" : "token {}".format(tok)}
data2 = {"title": "JARVIS Error Reporting System Reported An Error", "labels": ["Error"], "body": (e)}
url = "https://api.github.com/repos/Hashah2311/JARVIS/issues"
requests.post(url,data=json.dumps(data2),headers=headers)
exit()
6 changes: 0 additions & 6 deletions requirements.py

This file was deleted.

2 changes: 1 addition & 1 deletion run.cmd
Original file line number Diff line number Diff line change
@@ -1 +1 @@
env\python.exe Main.py
env\python.exe __init__.py
2 changes: 1 addition & 1 deletion run.ps1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
env\python.exe Main.py
env\python.exe __init__.py

0 comments on commit b9f68f1

Please sign in to comment.