Update docs and changelog to reflect the current state.
This commit is contained in:
parent
6112882d6b
commit
56d015694c
|
@ -9,6 +9,9 @@
|
||||||
as URL parameters.
|
as URL parameters.
|
||||||
* ``Result.pods`` now returns an iterator and not
|
* ``Result.pods`` now returns an iterator and not
|
||||||
a list.
|
a list.
|
||||||
|
* ``Pod`` objects are no longer iterable. To access
|
||||||
|
the subpods of a pod, simply use the ``Pod.subpod``
|
||||||
|
property.
|
||||||
* ``Result.tree`` and ``Pod.node`` have been removed.
|
* ``Result.tree`` and ``Pod.node`` have been removed.
|
||||||
* ``Result`` now additionally presents the new attributes:
|
* ``Result`` now additionally presents the new attributes:
|
||||||
- assumptions: An iterable of Assumptions.
|
- assumptions: An iterable of Assumptions.
|
||||||
|
|
11
README.rst
11
README.rst
|
@ -23,16 +23,17 @@ Result objects have `pods` (a Pod is an answer group from Wolfram Alpha)::
|
||||||
for pod in res.pods:
|
for pod in res.pods:
|
||||||
do_something_with(pod)
|
do_something_with(pod)
|
||||||
|
|
||||||
Pod objects have `subpods` (a Subpod is a specific response with the plaintext reply and some additional info)::
|
Pod objects have `subpods` (a Subpod is a specific response with the plaintext
|
||||||
|
reply and some additional info)::
|
||||||
|
|
||||||
for pod in res.pods:
|
for pod in res.pods:
|
||||||
for sub in pod:
|
for sub in pod.subpod:
|
||||||
print(sub.text)
|
print(sub.text)
|
||||||
|
|
||||||
You may also query for simply the pods which have 'Result' titles or are marked as 'primary'::
|
You may also query for simply the pods which have 'Result' titles or are
|
||||||
|
marked as 'primary' using ``Result.results``::
|
||||||
|
|
||||||
print(res.results[0].text[0])
|
print(next(res.results).text)
|
||||||
|
|
||||||
The interface as it is now does not have code built for accessing every piece of information that the Wolfram Alpha API could return. As such, every class has a copy of the original structure that it is supposed to parse. This copy is placed in a variable called node for every class but the Result class, whose variable is named tree. If there is information from the Wolfram Alpha API that you need for your program that this interface does not provide an exact function for then you can still gain access to that information through the previously mentioned variables; you'll just have to handle the API directly until the functionality you seek is built.
|
|
||||||
|
|
||||||
For more information, read the source.
|
For more information, read the source.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user