generated from Quantum-Accelerators/template
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
You could provide __main__.py so that you can call it from the command line with a scholar id or url
Something like the following:
import sys
from urllib.parse import urlparse, parse_qs
from coapy.scholar import get_coauthors
if len(sys.argv) != 2:
print("Usage: python -m coapy \"SCHOLAR_ID or URL\"")
sys.exit()
scholar_id = sys.argv[1]
outfile = "coauthors.csv"
if "scholar.google.com/" in scholar_id:
# We've been given a link. Extract the scholar id
scholar_id = parse_qs(urlparse(scholar_id).query)["user"][0]
get_coauthors(scholar_id=scholar_id, years_back=4, filename=outfile)
print(f"saved to {outfile}")Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels