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

Function get_recent_papers

skills/journal-fetcher/scripts/fetch_journal.py:1334–1380  ·  view source on GitHub ↗

获取最近 N 天的论文 Args: days: 最近 N 天 journals: 期刊列表 limit_per_journal: 每个期刊的数量限制 Returns: 论文列表

(
    days: int = 7,
    journals: List[str] = None,
    limit_per_journal: int = 20
)

Source from the content-addressed store, hash-verified

1332 end_date: str,
1333 journals: List[str] = None,
1334 limit: int = 50
1335) -> List[Dict[str, Any]]:
1336 """
1337 按日期范围获取论文(兼容 arxiv-fetcher 接口)
1338
1339 Args:
1340 start_date: 开始日期 (YYYYMMDD)
1341 end_date: 结束日期 (YYYYMMDD)
1342 journals: 期刊列表
1343 limit: 总数量限制
1344
1345 Returns:
1346 论文列表
1347 """
1348 if journals is None:
1349 journals = ["nature", "science", "cell"]
1350
1351 try:
1352 start_dt = datetime.strptime(start_date, "%Y%m%d")
1353 end_dt = datetime.strptime(end_date, "%Y%m%d")
1354 except ValueError:
1355 start_dt = None
1356 end_dt = None
1357
1358 window_days = 30
1359 if start_dt and end_dt:
1360 if start_dt > end_dt:
1361 start_dt, end_dt = end_dt, start_dt
1362 window_days = max(1, (end_dt - start_dt).days + 1)
1363
1364 all_papers = []
1365 limit_per_journal = max(limit // len(journals), 10)
1366
1367 for journal in journals:
1368 papers = fetch_journal_papers(
1369 journal=journal,
1370 limit=limit_per_journal,
1371 days=window_days
1372 )
1373 all_papers.extend(papers)
1374
1375 # 去重(基于 DOI 或 title)
1376 seen = set()
1377 unique_papers = []
1378 for paper in all_papers:
1379 key = paper.get('doi') or paper.get('title')
1380 if key and key not in seen:
1381 seen.add(key)
1382 unique_papers.append(paper)
1383

Callers

nothing calls this directly

Calls 3

normalize_journal_nameFunction · 0.85
getMethod · 0.80
fetch_journal_papersFunction · 0.70

Tested by

no test coverage detected