Dianel555/DSkills / skills/literature-searcher
literature-searcher
VerifiedSearch CrossRef, OpenAlex, PubMed, Semantic Scholar, and optional Scopus; deduplicate results, download open-access PDFs by DOI, classify papers, monitor new results, and analyze coverage. Use when asked to search literature, monitor a topic, download an open-access paper, classify papers, or analyze literature gaps.
| File | Kind | Size |
|---|---|---|
| .env.example | other | 743 B |
| README.md | markdown | 3.7 KB |
| SKILL.md | skill md | 2.9 KB |
| literature_searcher/__init__.py | script | 3.1 KB |
| literature_searcher/classifier.py | script | 11.2 KB |
| literature_searcher/crossref_searcher.py | script | 2.8 KB |
| literature_searcher/downloader.py | script | 5.3 KB |
| literature_searcher/insight.py | script | 6.0 KB |
| literature_searcher/monitor.py | script | 14.3 KB |
| literature_searcher/openalex_searcher.py | script | 3.0 KB |
| literature_searcher/pubmed_searcher.py | script | 6.1 KB |
| literature_searcher/scopus_searcher.py | script | 2.1 KB |
| literature_searcher/searcher.py | script | 3.4 KB |
| literature_searcher/semantic_scholar_searcher.py | script | 3.7 KB |
| monitor_config.json.template | other | 443 B |
| tests/test_literature_searcher.py | script | 9.7 KB |
| tests/test_retry_budget.py | script | 898 B |
literature_searcher/scopus_searcher.py
View on GitHub"""
Scopus API 搜索
"""
import json
import urllib.parse
import urllib.request
from typing import List, Optional
from . import (
SCOPUS_API, USER_AGENT, ELSEVIER_API_KEY, SCOPUS_API_KEY, Paper,
safe_int,
)
class ScopusSearcher:
"""Scopus API 搜索器"""
@staticmethod
def search(query: str, limit: int = 20, year_from: Optional[int] = None,
year_to: Optional[int] = None, api_key: Optional[str] = None) -> List[Paper]:
api_key = api_key or ELSEVIER_API_KEY or SCOPUS_API_KEY
if not api_key:
print("[Scopus] 需要ELSEVIER_API_KEY,跳过")
return []
papers = []
try:
params = {
"query": query,
"count": min(limit, 25),
}
if year_from or year_to:
yf = year_from or ""
yt = year_to or ""
params["date"] = f"{yf}-{yt}"
url = f"{SCOPUS_API}?{urllib.parse.urlencode(params)}"
req = urllib.request.Request(url)
req.add_header("User-Agent", USER_AGENT)
req.add_header("X-ELS-APIKey", api_key)
req.add_header("Accept", "application/json")
with urllib.request.urlopen(req, timeout=30) as resp:
data = json.loads(resp.read().decode("utf-8"))
for entry in data.get("search-results", {}).get("entry", []):
authors = []
if "creator" in entry:
authors = [entry["creator"].get("$", "")]
papers.append(Paper(
title=entry.get("dc:title", ""),
abstract="",
authors=authors,
doi=entry.get("prism:doi", ""),
year=safe_int(entry.get("prism:coverDate", "")[:4]),
citations=safe_int(entry.get("citedby-count", "0")),
journal=entry.get("prism:publicationName", ""),
source_platform="scopus",
issn=entry.get("prism:issn", ""),
))
except Exception as e:
print(f"[Scopus] 搜索错误: {e}")
return papers[:limit]
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |