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

Callers 1

collect_papersFunction · 0.70

Calls 3

getMethod · 0.80
nowMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected