Git Product home page Git Product logo

voiceassistant's Introduction

VoiceAssistant

images

rony is a voice assistant it helps to search on goole using voice more task also he do like time , date , day , wikipedia , tempterature You need to add more task then add tasks in task file and make a query in main.py file

Libraries required to install using Pip Command:

1.json

2.torch

3.random

4.numpy

5.nltk

6.pyttsx3

7.requests

8.pywhatkit

9.pywikihow

task file required internet....... Run.

voiceassistant's People

Stargazers

 avatar

Watchers

 avatar

Forkers

scriptonics

voiceassistant's Issues

Online payment

from decimal import Decimal, localcontextimport requests, hashlibfrom six.moves.urllib_parse import quote_plus, parse_qs class Paynow(object): """Instantiates the Paynow Object""" WEB_URL: str = "https://www.paynow.co.zw/interface/initiatetransaction" MOBILE_URL: str = "https://www.paynow.co.zw/interface/remotetransaction" def init( self, pid: str = "", pkey: str = "", returnurl: str = "", resulturl: str = "", authemail: str = "", phone: str = None, ): self.pid = pid self.pkey = pkey self.returnurl = returnurl self.resulturl = resulturl self.authemail = authemail self.phone = phone self.reference = "" self.products: dict = {} self.frompaynow: dict = {} self.method: str = "ecocash" def set_response_from_paynow(self, resp) -> dict: """ Setter for response from Paynow """ self.frompaynow = self.decrypt(resp) return self.frompaynow def total(self) -> float: """ calculate the total of products in cart to two decimal point """ with localcontext() as ctx: ctx.prec = 2 amount = sum(value for value in self.products.values()) if amount <= 1: raise ValueError("Payments less than $1 are disallowed!") return float(Decimal(amount).quantize(Decimal(".00"))) def send_payment(self, reference, products) -> dict: """ Sends the transaction to Paynow""" data = self.build_request(reference, products) try: if data["method"]: # for mobile payments return self.set_response_from_paynow( requests.post(self.MOBILE_URL, data=data) ) # URL that handles web payments return self.set_response_from_paynow(requests.post(self.WEB_URL, data=data)) except Exception as e: raise e def status_update(self): pollurl = self.frompaynow.get("pollurl", "") data = requests.post(pollurl) if pollurl else "" try: return self.decrypt(data) except Exception: pass return data def encrypt(self, data) -> str: message = "" for key, value in data.items(): if str(key).lower() == "hash": continue message += str(value) message += self.pkey return hashlib.sha512(message.encode("utf-8")).hexdigest().upper() def decrypt(self, data) -> dict: # TODO check functionality here try: data = parse_qs(data.text) except Exception as e: print(e) def build_request(self, reference, products): """ Build the required post object for Paynow API""" self.reference = reference for key, amount in products.items(): self.products[key] = float(amount) body = { "id": self.pid, "reference": self.reference, "amount": self.total(), "additionalinfo": "xyz", "returnurl": self.returnurl, "resulturl": self.resulturl, "authemail": self.authemail, "phone": self.phone, "method": self.method, "Status": "Message", } for key, value in body.items(): if key == "authemail": continue body[key] = quote_plus(str(value)) body["Hash"] = self.encrypt(body) return body

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.