1717 ProcessCSV ,
1818)
1919from indico .queries .export import CreateExport , DownloadExport
20- from indico .types .dataset import Dataset , OmnipageOcrOptionsInput , TableReadOrder , OcrEngine
20+ from indico .types .dataset import Dataset , OmnipageOcrOptionsInput , TableReadOrder , OcrEngine , ReadApiOcrOptionsInput
2121from indico .errors import IndicoRequestError
2222from tests .integration .data .datasets import airlines_dataset
2323
@@ -36,7 +36,6 @@ def test_create_dataset(indico):
3636 assert response .status == "COMPLETE"
3737 assert isinstance (response .id , int )
3838
39-
4039def test_get_datasets (indico , airlines_dataset ):
4140 client = IndicoClient ()
4241 dataset = client .call (GetDataset (id = airlines_dataset .id ))
@@ -189,7 +188,32 @@ def test_create_with_options(indico):
189188 }
190189 dataset = client .call (CreateEmptyDataset (name = f"dataset-{ int (time .time ())} " , ocr_engine = OcrEngine .OMNIPAGE ,
191190 omnipage_ocr_options = config ))
191+
192+ def test_create_with_options_readapi (indico ):
193+ client = IndicoClient ()
194+ config : ReadApiOcrOptionsInput = {
195+ "auto_rotate" : True ,
196+ "single_column" : False ,
197+ "upscale_images" : True ,
198+ "languages" : ["AUTO" ]
199+ }
200+ dataset = client .call (CreateEmptyDataset (name = f"dataset-{ int (time .time ())} " , ocr_engine = OcrEngine .READAPI ,
201+ readapi_ocr_options = config ))
202+
203+ def test_create_from_files_with_readapiv2 (indico ):
204+ client = IndicoClient ()
205+ dataset = client .call (CreateEmptyDataset (name = f"dataset-{ int (time .time ())} " , ocr_engine = OcrEngine .READAPI_V2 ))
206+ file_names = ["us_doi.tiff" , "mock.pdf" ]
207+ parent_path = str (Path (__file__ ).parent .parent / "data" )
208+ dataset_filepaths = [
209+ os .path .join (parent_path , file_name ) for file_name in file_names
210+ ]
192211
212+ dataset = client .call (AddFiles (dataset_id = dataset .id , files = [dataset_filepaths [0 ]], autoprocess = True ))
213+ dataset = client .call (AddFiles (dataset_id = dataset .id , files = [dataset_filepaths [1 ]], autoprocess = True ))
214+
215+ _dataset_complete (dataset )
216+
193217
194218def test_create_from_files_document_without_autoprocess (indico ):
195219 client = IndicoClient ()
0 commit comments