MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / save_paper

Function save_paper

scripts/collect_papers_by_date.py:57–74  ·  view source on GitHub ↗

保存单篇论文到数据库

(conn: sqlite3.Connection, paper: Dict)

Source from the content-addressed store, hash-verified

55
56
57def save_paper(conn: sqlite3.Connection, paper: Dict) -> None:
58 """保存单篇论文到数据库"""
59 conn.execute("""
60 INSERT OR REPLACE INTO papers
61 (arxiv_id, title, abstract, authors, categories, publish_date, pdf_url, doi, created_at)
62 VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
63 """, (
64 paper.get("arxiv_id", ""),
65 paper.get("title", ""),
66 paper.get("abstract", ""),
67 ",".join(paper.get("authors", [])),
68 ",".join(paper.get("categories", [])),
69 paper.get("publish_date", ""),
70 paper.get("pdf_url", ""),
71 paper.get("doi", ""),
72 datetime.now().isoformat(),
73 ))
74 conn.commit()
75
76
77def collect_papers(

Callers 1

collect_papersFunction · 0.70

Calls 3

getMethod · 0.80
nowMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected