Last active
June 3, 2019 21:05
-
-
Save LeoSaucedo/d1f1d95e9e2f21d265719d511b9bc911 to your computer and use it in GitHub Desktop.
Wolfram API for Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Wolfram API implementation for Python. | |
Returns queries as a text file. | |
Carlos Saucedo, 2019 | |
""" | |
import wolframalpha | |
class Client(object): | |
def __init__(self, key): | |
self.key = key | |
self.client = wolframalpha.Client(key) | |
# Processes a user query. | |
def ask(self, queryText): | |
res = self.client.query(queryText) | |
return next(res.results).text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment