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

Function save_paper

scripts/collect_all_papers.py:91–109  ·  view source on GitHub ↗

保存单篇论文到数据库(适配当前表结构)

(conn: sqlite3.Connection, paper: Dict)

Source from the content-addressed store, hash-verified

89
90
91def save_paper(conn: sqlite3.Connection, paper: Dict) -> None:
92 """保存单篇论文到数据库(适配当前表结构)"""
93 # 当前表结构:id, arxiv_id, doi, title, authors, institution, abstract, venue, publish_date, embedding, embedding_model, fetched_at, pushed, push_date
94 conn.execute("""
95 INSERT OR REPLACE INTO papers
96 (arxiv_id, doi, title, abstract, authors, institution, venue, publish_date, fetched_at)
97 VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
98 """, (
99 paper.get("arxiv_id", ""),
100 paper.get("doi", ""),
101 paper.get("title", ""),
102 paper.get("abstract", ""),
103 paper.get("authors", ""),
104 paper.get("venue", ""), # institution 用 venue 填充
105 paper.get("venue", ""),
106 paper.get("publish_date", ""),
107 datetime.now().isoformat(),
108 ))
109 conn.commit()
110
111
112def collect_from_source(

Callers 1

collect_from_sourceFunction · 0.70

Calls 3

getMethod · 0.80
nowMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected