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

Function export_file

Python/requests/pdf2file.py:42–55  ·  view source on GitHub ↗
(uid: str, to_format: str, formula_mode: str)

Source from the content-addressed store, hash-verified

40
41
42def export_file(uid: str, to_format: str, formula_mode: str):
43 url = f"{base_url}/api/v2/convert/parse"
44 headers = {"Authorization": f"Bearer {secret}"}
45 payload = {
46 "uid": uid,
47 "to": to_format,
48 "formula_mode": formula_mode,
49 }
50 res = rq.post(url, headers=headers, json=payload)
51 res.raise_for_status() # 检查HTTP请求是否成功
52 data = res.json()
53 if data.get("code") == "success":
54 return data["data"]
55 raise Exception(f"export file failed: {data}")
56
57
58def get_export_result(uid: str):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected