Skip to content

Commit

Permalink
Merge pull request #2 from PraaneshSelvaraj/setup
Browse files Browse the repository at this point in the history
✨Added setup.py for easy setup
  • Loading branch information
PraaneshSelvaraj committed Oct 7, 2022
2 parents b2d7187 + 4ec84b6 commit e4cbbdd
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The simplest way to install Maxx-AI is to clone the maxx-ai repo to your system
```
git clone https://github.com/PraaneshSelvaraj/maxx-ai.git
cd maxx-ai/
pip install -r requirements.txt
python setup.py
pythonw maxx.pyw
```

Expand Down
20 changes: 0 additions & 20 deletions requirements.txt

This file was deleted.

65 changes: 65 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import os
from subprocess import call
from time import sleep
import json

call(["pip","install","gTTS","playsound==1.2.2"])

from gtts import gTTS
from playsound import playsound

def speak(txt):
tts=gTTS(txt,lang='en',tld='ca')
tts.save('output.mp3')
sleep(0.5)
print(txt)
playsound("output.mp3")
os.remove("output.mp3")

speak("Hi, I am Maxx.")
speak("People say that I am an A.I, But I am your bestfriend.")
speak("I am going to move in and live with you.")
speak("Let me pack up my things from my home server and shift them to your system.")

packages =["SpeechRecognition","wolframalpha","pyscreenshot","prompt_toolkit","pyaudio","wikipedia","psutil", "pyttsx3",
"google-api-python-client","google-auth-httplib2","google-auth-oauthlib","PyQt5","PySide2","pywin32","pillow"]

for package in packages:
call(["pip","install",package])

speak("I've just moved in to your system.")
speak("Let's have a party")

speak("Oops, I can't find your songs, can you show me where you save your songs?")

from tkinter import Tk
from tkinter import filedialog

window=Tk()
window.title('Maxx-AI')

songs_path = filedialog.askdirectory()
if songs_path:
window.destroy()

songs_path = songs_path.replace("/","\\")
songs_path+="\\"

with open("./assets/config.json","r") as f:
user_config = json.load(f)
f.close()

user_config['songs_path'] = songs_path

with open("./assets/config.json","w") as f:
json.dump(user_config, f, indent=3)
f.close()

speak("I need access to your google account to see your calendar events.")
speak("Don't worry, I am not going to steal your data.")

from includes import google_con
google_service_calendar = google_con.build_service("calendar")

speak("That's it, we are officially roommates.")
speak("If you wanna talk with me, I am always waiting for you in the taskbar.")

0 comments on commit e4cbbdd

Please sign in to comment.