@@ -933,3 +933,84 @@ def _read_url(self, url, add_authentication=False, data=None):
933933 string .write (chunk )
934934
935935 return return_code , string .getvalue ()
936+
937+ def upload_dataset (self , dataset , description ):
938+ try :
939+ data = {'dataset' : dataset , 'description' : description }
940+ return_code , dataset_xml = self ._perform_api_call ("openml.data.upload" ,data = data )
941+
942+ except URLError as e :
943+ # TODO logger.debug
944+ print (e )
945+ raise e
946+ return return_code , dataset_xml
947+
948+ def upload_dataset (self , description ):
949+ try :
950+ data = {'description' : description }
951+ return_code , dataset_xml = self ._perform_api_call ("openml.data.upload" ,data = data )
952+
953+ except URLError as e :
954+ # TODO logger.debug
955+ print (e )
956+ raise e
957+ return return_code , dataset_xml
958+
959+ def upload_dataset_features (self , description ):
960+ try :
961+ data = {'description' : description }
962+ return_code , dataset_xml = self ._perform_api_call ("openml.data.features.upload" , data = data )
963+
964+ except URLError as e :
965+ # TODO logger.debug
966+ print (e )
967+ raise e
968+ return return_code , dataset_xml
969+
970+ def upload_dataset_qualities (self , description ):
971+ try :
972+ data = {'description' : description }
973+ return_code , dataset_xml = self ._perform_api_call ("openml.data.qualities.upload" , data = data )
974+
975+ except URLError as e :
976+ # TODO logger.debug
977+ print (e )
978+ raise e
979+ return return_code , dataset_xml
980+
981+ def upload_implementation (self , description , binary , source ):
982+ try :
983+ data = {'description' : description , 'binary' : binary , 'source' : source }
984+ return_code , dataset_xml = self ._perform_api_call ("openml.implementation.upload" , data = data )
985+
986+ except URLError as e :
987+ # TODO logger.debug
988+ print (e )
989+ raise e
990+ return return_code , dataset_xml
991+
992+ def upload_run (self , description , files ):
993+ try :
994+ data = {'description' : description }
995+ for key , value in files :
996+ data [key ] = value
997+
998+ return_code , dataset_xml = self ._perform_api_call ("openml.run.upload" , data = data )
999+
1000+ except URLError as e :
1001+ # TODO logger.debug
1002+ print (e )
1003+ raise e
1004+ return return_code , dataset_xml
1005+
1006+ def upload_file (self , file ):
1007+ try :
1008+ data = {'file' : file }
1009+ return_code , dataset_xml = self ._perform_api_call ("openml.file.upload" , data = data )
1010+
1011+ except URLError as e :
1012+ # TODO logger.debug
1013+ print (e )
1014+ raise e
1015+ return return_code , dataset_xml
1016+
0 commit comments