mwclient - browsebysubject - SMW

71 Views Asked by At

I have been toying around with mwclient to query a wiki installations running the SMW extension.

It is quite convenient to have the "ask" method available to the mwclient.client.Site. However I want to take my queries further and use the browsebysubject API module to get all the property::value pairs of a particular page. Just like in the example: http://www.beachapedia.org/api.php?action=browsebysubject&subject=Bogue_Banks&format=json in which the page Bogue_Banks is "browsed", with the API returning page properties and values.

Now mwclient does not have a browsebysubject method. Given that fact what would be the way to go about doing that query with mwclient? With the raw_api method?

If you could provide an example it would be great

Cheers

1

There are 1 best solutions below

0
Andre On

The generic API method is the way to go:

site.api('browsebysubject', subject='Bogue_Banks')