graphspace_python.api package¶
Submodules¶
graphspace_python.api.client module¶
-
class
graphspace_python.api.client.GraphSpace(username, password)[source]¶ Bases:
objectGraphSpace client class.
Connects the user with GraphSpace.
Makes request to the GraphSpace REST APIs and returns the response.
Parameters: Example
Initialising a GraphSpace client can be done in the following way:
>>> from graphspace_python.api.client import GraphSpace >>> graphspace = GraphSpace('user1@example.com', 'user1')
-
set_api_host(host)[source]¶ Manually set host address of GraphSpace REST APIs.
Parameters: host (str) – Host address of GraphSpace APIs. Example
>>> from graphspace_python.api.client import GraphSpace >>> graphspace = GraphSpace('user1@example.com', 'user1') >>> graphspace.set_api_host('localhost:8000')
-
graphspace_python.api.config module¶
graphspace_python.api.errors module¶
-
class
graphspace_python.api.errors.ErrorHandler[source]¶ Bases:
objectErrorHandler class.
Exception handling class for GraphSpace API’s HTTP errors.
-
raise_error(error, response)[source]¶ Raises exception based on the ‘error_code’ received in response when any HTTP error occurs in API call.
Parameters: Raises: GraphSpaceError– If an error response is received from the API call, it raises any one of the GraphSpaceError depending upon the error code.
-
-
exception
graphspace_python.api.errors.GraphSpaceError(status_code, reason, response)[source]¶ Bases:
ExceptionGraphSpaceError class.
Base error class for the GraphSpace HTTP errors.
-
exception
graphspace_python.api.errors.LayoutNameAlreadyExists(status_code, reason, response)[source]¶