MCPcopy Create free account
hub / github.com/NoEdgeAI/doc2x-doc / get_status

Function get_status

Python/requests/pdf2file.py:27–35  ·  view source on GitHub ↗
(uid: str)

Source from the content-addressed store, hash-verified

25
26
27def get_status(uid: str):
28 url = f"{base_url}/api/v2/parse/status?uid={uid}"
29 headers = {"Authorization": f"Bearer {secret}"}
30 res = rq.get(url, headers=headers)
31 res.raise_for_status() # 检查HTTP请求是否成功
32 data = res.json()
33 if data.get("code") == "success":
34 return data["data"]
35 raise Exception(f"get status failed: {data}")
36
37
38#! 此上部分与pdf.py相同,是用于上传文件并等待解析完成的代码

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected