Integrates the WA(Wolfram|Alpha) using its library and API in python. Included some extra cool feature, up for you to know :)
![](https://static.wixstatic.com/media/fcac84_0c385806080b46dbb93a864f30c61bef~mv2.jpg/v1/fill/w_352,h_62,al_c,q_80,enc_auto/fcac84_0c385806080b46dbb93a864f30c61bef~mv2.jpg)
Most well known computational knowledge engine on tech today, WA, is pretty astounding. Stephen Wolfram has revolutionized computing with the success of such innovation. I think with this sort of tech it won't only solve the future but also has made I giant leap on the world of computing. Development of such amazing project took 3 decades, which indeed give me the motivation to never give up on achieving the finish line.
In a nutshell...
For me wolframalpha is the brain of the world's information. It contains all the knowledge such as facts, computations, statistics, laws, history, biography and the lists goes. These are then stored in a gazillion sized storage box, which are then served once user asks for any. To sum this paragraph up, wolframalpha = knowledge + computation = answers.
How does this works?
![](https://static.wixstatic.com/media/fcac84_694320b9fe904ce98967feeb51dbbb68~mv2.jpg/v1/fill/w_672,h_579,al_c,q_85,enc_auto/fcac84_694320b9fe904ce98967feeb51dbbb68~mv2.jpg)
From the above image(which I don't own) (a) User query in infos they need. This infos are broken down into its most significant strings or keywords. (b)Using its own algorithm, these keywords are then digested to the WA's container and (3)would provide the user the exact the output needed.
With its 30 years of development , Stephen Wolfram and the team created a language that would satisfy this amazing work of art.This language became known as the Mathematica. It is the language of the world, the language for the computational knowledge. It is the ultimate fusion of languages because of its symbolic nature in any form of programming. Symbolic, because it is a language that has the model of the world built in.
The Integration to Python
WA is one of the coolest tech feature I have ever seen in my entire life. My interest with this leads me to an implementation that would later be useful for my future project(a secret for now). I have thought about this for some time, to create a program that would connect to WA's server, perhaps an API. I am not a big fan of API's for it has lots of limitations and I can't do anything with it. For me API let me play a game on a developer's rule. So I've tried my method of scraping WA myself, just like what I did my Spyder project. But to no avail, site don't allow to crawl, which is just a bummer on my side! So plan B, looks like I'll stick with the API then. Below is the result, when trying to launch my crawler.
![](https://static.wixstatic.com/media/fcac84_a48ec0a063624f42bdcb24da8cb0184c~mv2.jpg/v1/fill/w_818,h_185,al_c,q_80,enc_auto/fcac84_a48ec0a063624f42bdcb24da8cb0184c~mv2.jpg)
To start, first you must sign on the developer's page to get the API code.
![](https://static.wixstatic.com/media/fcac84_87e4ebabce574ad381f17df2dc5c62f7~mv2.jpg/v1/fill/w_980,h_612,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/fcac84_87e4ebabce574ad381f17df2dc5c62f7~mv2.jpg)
Upon logging in, go to the My Apps tab to start creating your first app. Click the Sign up to get your first AppID button to start the app creation process. After a one-time survey about intended usage, the AppID creation dialog will appear. Give your application a name and a simple description to register an AppID. Each application must have its own unique AppID.
Once you got the ID, it's time to import wolframalpha library on python. You can do this by,
pip install wolframalpha
Once installed, provide the raw input from user syntax,
input_test = raw_input("Ask me: ")
Then, create a variable that would store your query on the API,
res = client.query(input_test)
From there, you may now proceed with the parsing.
I mentioned that I added some extra feature to this program, and that would be... speech recognition! To make it cooler and have the AI feel, I involved Python's Text to Speech(pytts) on the mix. I will provide the video later, for now, kindly look at the sample screenshot of the program.
![](https://static.wixstatic.com/media/fcac84_4e549a41ba5047efac0ff1a1c0f83b32~mv2.jpg/v1/fill/w_459,h_124,al_c,q_80,enc_auto/fcac84_4e549a41ba5047efac0ff1a1c0f83b32~mv2.jpg)
![](https://static.wixstatic.com/media/fcac84_518ff4a45da24f1783b6779f38ffa43f~mv2.jpg/v1/fill/w_268,h_42,al_c,q_80,enc_auto/fcac84_518ff4a45da24f1783b6779f38ffa43f~mv2.jpg)
![](https://static.wixstatic.com/media/fcac84_2fb534b058ce410e971822a53ef6cbe9~mv2.jpg/v1/fill/w_666,h_53,al_c,q_80,enc_auto/fcac84_2fb534b058ce410e971822a53ef6cbe9~mv2.jpg)
![](https://static.wixstatic.com/media/fcac84_ce65852fc558488487b969e697ca6708~mv2.jpg/v1/fill/w_303,h_93,al_c,q_80,enc_auto/fcac84_ce65852fc558488487b969e697ca6708~mv2.jpg)
![](https://static.wixstatic.com/media/fcac84_e2536e641bf4412397fc8fc8abae5af0~mv2.jpg/v1/fill/w_418,h_32,al_c,q_80,enc_auto/fcac84_e2536e641bf4412397fc8fc8abae5af0~mv2.jpg)
![](https://static.wixstatic.com/media/fcac84_bdcdd8b7fedc47218fcb80858fc29dd6~mv2.jpg/v1/fill/w_273,h_32,al_c,q_80,enc_auto/fcac84_bdcdd8b7fedc47218fcb80858fc29dd6~mv2.jpg)
This is it for now, stay stuned for this post's video version. =)
Comments