echovr_api.api module¶
-
class
echovr_api.api.
API
(base_url='http://127.0.0.1/')[source]¶ Bases:
object
An interface to the Echo VR API
Parameters: base_url – The base URL used to communicate with the Echo VR API -
fetch_state
()[source]¶ Returns: A
GameState
object representing the state of the current game session as presented by the API.Raises: - requests.exceptions.ConnectionError – This exception will be thrown if the API is unavaible. This might indicate that the user is not currently in a match, or that they didn’t launch Echo VR with the -http option.
- json.decoder.JSONDecodeError – This exception will be thrown if the data returned by the API is not valid JSON. Likely indicates a bug in Echo VR or in this library.
-
fetch_state_data
()[source]¶ Fetch the raw JSON game state data from EchoVR’s
/session
APIThis method could be useful if you want to retrieve some API data not directly exposed by this Python wrapper. Otherwise, you should probably use
fetch_state()
instead.Returns: An object (probably a
dict
) representing the raw JSON response returned by the EchoVR client.Raises: - requests.exceptions.ConnectionError – This exception will be thrown if the API is unavaible. This might indicate that the user is not currently in a match, or that they didn’t launch Echo VR with the -http option.
- json.decoder.JSONDecodeError – This exception will be thrown if the data returned by the API is not valid JSON. Likely indicates a bug in Echo VR or in this library.
-
-
echovr_api.api.
DEFAULT_API
= <echovr_api.api.API object>¶ An instance of API, with the default base URL.
-
echovr_api.api.
fetch_state
= <bound method API.fetch_state of <echovr_api.api.API object>>¶ Shortcut for calling fetch_state on DEFAULT_API
-
echovr_api.api.
fetch_state_data
= <bound method API.fetch_state_data of <echovr_api.api.API object>>¶ Shortcut for calling fetch_state_data on DEFAULT_API