(self, form_data: dict, method_name="superconductors", params={}, headers={"Accept": "application/json"})
| 311 | return status, json.loads(res.text) |
| 312 | |
| 313 | def process_pdf(self, form_data: dict, method_name="superconductors", params={}, headers={"Accept": "application/json"}): |
| 314 | |
| 315 | the_url = self.get_url(method_name) |
| 316 | params, the_url = self.get_params_from_url(the_url) |
| 317 | |
| 318 | res, status = self.post(url=the_url, files=form_data, data=params, headers=headers) |
| 319 | |
| 320 | if status == 503: |
| 321 | time.sleep(self.config["sleep_time"]) |
| 322 | return self.process_text(input, method_name, params, headers) |
| 323 | elif status != 200: |
| 324 | print("Processing failed with error " + str(status)) |
| 325 | else: |
| 326 | return res.text |
| 327 | |
| 328 | def process_pdfs(self, pdf_files, params={}): |
| 329 | pass |
no test coverage detected