@@ -92,9 +92,9 @@ class knora:
9292 def __init__ (self , server : str , email : str , password : str , prefixes : Dict [str ,str ] = None ):
9393 """
9494 Constructor requiring the server address, the user and password of KNORA
95- :param server: Adress of the server, e.g http://data.dasch.swiss
96- :param user: Username for Knora e.g., root@example.com
97- :param password: The password , e.g. test
95+ :param server: Address of the server, e.g http://data.dasch.swiss
96+ :param email: Email of user, e.g., root@example.com
97+ :param password: Password of the user , e.g. test
9898 """
9999 self .server = server
100100 self .prefixes = prefixes
@@ -105,23 +105,27 @@ def __init__(self, server: str, email: str, password: str, prefixes: Dict[str,st
105105 }
106106 jsondata = json .dumps (credentials )
107107
108- req = requests .post (self .server + '/v2/authentication' ,
109- headers = {'Content-Type' : 'application/json; charset=UTF-8' },
110- data = jsondata )
108+ req = requests .post (
109+ self .server + '/v2/authentication' ,
110+ headers = {'Content-Type' : 'application/json; charset=UTF-8' },
111+ data = jsondata
112+ )
113+
111114 self .on_api_error (req )
112115
113116 result = req .json ()
114117 self .token = result ["token" ]
115118
116119 def __del__ (self ):
117- req = requests .delete (self .server + '/v2/authentication' ,
118- headers = {'Authorization' : 'Bearer ' + self .token })
119- result = req .json ()
120+ req = requests .delete (
121+ self .server + '/v2/authentication' ,
122+ headers = {'Authorization' : 'Bearer ' + self .token }
123+ )
120124
125+ result = req .json ()
121126 pprint .pprint (result )
122127
123128
124-
125129 def on_api_error (self , res ):
126130 """
127131 Method to check for any API errors
0 commit comments