Welcome to wolframalpha documentation!

class wolframalpha.Assumption

Bases: wolframalpha.Document

text
class wolframalpha.Client(app_id)

Bases: object

Wolfram|Alpha v2.0 client

Pass an ID to the object upon instantiation, then query Wolfram Alpha using the query method.

query(input, params=(), **kwargs)

Query Wolfram|Alpha using the v2.0 API

Allows for arbitrary parameters to be passed in the query. For example, to pass assumptions:

client.query(input=’pi’, assumption=’*C.pi-_*NamedConstant-‘)

To pass multiple assumptions, pass multiple items as params:

params = (
(‘assumption’, ‘*C.pi-_*NamedConstant-‘), (‘assumption’, ‘DateOrder_**Day.Month.Year–’),

) client.query(input=’pi’, params=params)

For more details on Assumptions, see https://products.wolframalpha.com/api/documentation.html#6

class wolframalpha.Document

Bases: dict

classmethod from_doc(doc)

Load instances from the xmltodict result. Always return an iterable, even if the result is a singleton.

class wolframalpha.ErrorHandler(*args, **kwargs)

Bases: object

class wolframalpha.Image

Bases: wolframalpha.Document

Holds information about an image included with an answer.

class wolframalpha.Pod(*args, **kwargs)

Bases: wolframalpha.ErrorHandler, wolframalpha.Document

Groups answers and information contextualizing those answers.

primary
subpods
text
texts

The text from each subpod in this pod as a list.

class wolframalpha.Result(stream)

Bases: wolframalpha.ErrorHandler, wolframalpha.Document

Handles processing the response for the programmer.

assumptions
details

A simplified set of answer text by title.

info

The pods, assumptions, and warnings of this result.

pods
results

The pods that hold the response to a simple, discrete query.

warnings
class wolframalpha.Subpod

Bases: wolframalpha.Document

Holds a specific answer or additional information relevant to said answer.

class wolframalpha.Warning

Bases: wolframalpha.Document

wolframalpha.xml_bool(str_val)
>>> xml_bool('true')
True
>>> xml_bool('false')
False

Indices and tables