Wiki
Utility functions for dealing with the wiki (https://wiki.auto-pi-lot.com).
See the docstrings of the ask() function, as well as the guide_plugins_wiki section
in the user guide for use.
Functions:
|
Perform an API call to the wiki using the ask API and simplify to a list of dictionaries |
|
Use the browse api of the wiki to search for specific pages, properties, and so on. |
|
Create a query string to request semantic information from the Autopilot wiki |
|
- ask(filters: List[str] | str, properties: None | List[str] | str = None) List[dict][source]
Perform an API call to the wiki using the ask API and simplify to a list of dictionaries
- Parameters:
filters (list, str) – A list of strings or a single string of semantic mediawiki formatted property filters. See
make_ask_string()for more informationproperties (None, list, str) – Properties to return from filtered pages, See
make_ask_string()for more information
Returns:
- browse(search: str, browse_type: str = 'page', params: dict | None = None)[source]
Use the browse api of the wiki to search for specific pages, properties, and so on.
- Parameters:
search (str) – the search string!
*can be used as a wildcard.browse_type (str) – The kind of browsing we’re doing, one of:
page
subject
property
pvalue
category
concept
params (dict) – Additional params for the browse given as a dictionary, see the smw docs for usage.
- Returns:
dict, list of dicts of results
- make_ask_string(filters: List[str] | str, properties: None | List[str] | str = None, full_url: bool = True) str[source]
Create a query string to request semantic information from the Autopilot wiki
- Parameters:
filters (list, str) – A list of strings or a single string of semantic mediawiki formatted property filters, eg
"[[Category:Hardware]]"or"[[Has Contributor::sneakers-the-rat]]". Refer to the semantic mediawiki documentation for more information on syntaxproperties (None, list, str) – Properties to return from filtered pages, see the available properties on the wiki and the semantic mediawiki documentation for more information on syntax. If
None(default), just return the names of the pagesfull_url (bool) – If
True(default), prependf'{WIKI_URL}api.php?action=ask&query='to the returned string to make it ready for an API call
- Returns:
the formatted query string
- Return type: