Tutorial
Contents
Tutorial#
Here we will show the basic commands for working with pygscholar
. When you install pygscholar
you will get access to the scholar
command which you can use in the terminal. In this tutorial we are running the commands from a notebook and therefore all commands starts with a !
. However if you are using a terminal, then you should not use the !
in front of the command.
The help option#
To see all the available options, you can type
$ scholar --help
!scholar --help
Usage: scholar [OPTIONS] COMMAND [ARGS]...
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --version Show version │
│ --license Show license │
│ --install-completion [bash|zsh|fish|powershe Install completion for │
│ ll|pwsh] the specified shell. │
│ [default: None] │
│ --show-completion [bash|zsh|fish|powershe Show completion for the │
│ ll|pwsh] specified shell, to │
│ copy it or customize │
│ the installation. │
│ [default: None] │
│ --help Show this message and │
│ exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────╮
│ add-author Add new author │
│ list-author-publications List authors publications │
│ list-authors List all authors │
│ list-department-publications List department publications │
│ list-new-dep-publications List new publications for the department │
│ post-slack-new-dep-publications Post new publications for the department to │
│ Slack │
│ remove-author Remove author │
│ search-author Search for authors │
╰──────────────────────────────────────────────────────────────────────────────╯
This will list all the available options with a message explaining the different sub-commands. For each sub-command you can also use the --help
option, e.g
$ scholar add-author --help
!scholar add-author --help
Usage: scholar add-author [OPTIONS] NAME
Add new author
╭─ Arguments ──────────────────────────────────────────────────────────────────╮
│ * name TEXT [default: None] [required] │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --scholar-id TEXT │
│ --cache-dir TEXT [default: /home/runner/.pygscholar] │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
Listing publications for the whole department#
Our department now consists of two researchers (Henrik Finsberg and Joakim Sundnes), but you could imaging that you have a lot of researchers in your department. It would then be nice to list the most cited papers across the whole department. We can do this with the
$ scholar list-department-publications
command. Let us first loook at the help menu
!scholar list-department-publications --help
Usage: scholar list-department-publications [OPTIONS]
List department publications
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --n INTEGER [default: 5] │
│ --sort-by-citations --no-sort-by-citati… [default: │
│ sort-by-citations] │
│ --add-authors --no-add-authors [default: │
│ no-add-authors] │
│ --max-age INTEGER [default: None] │
│ --cache-dir TEXT [default: │
│ /home/runner/.pygsc… │
│ --help Show this message │
│ and exit. │
╰──────────────────────────────────────────────────────────────────────────────╯
Let us list the most cited papers not older than 2 year using the command
$ scholar list-department-publications --max-age=2
!scholar list-department-publications --max-age=2
2023-01-10 09:04:53 [info ] Get publication for Henrik Nicolay Finsberg with id NDPIHoEAAAAJ
2023-01-10 09:04:53 [info ] Get author info for Henrik Nicolay Finsberg
2023-01-10 09:04:53 [info ] Get publication for Joakim Sundnes with id YfOpQUcAAAAJ
2023-01-10 09:04:53 [info ] Get author info for Joakim Sundnes
Publications for department (Sorted by citations)
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┓
┃ Title ┃ Published year ┃ Number of citations ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━┩
│ Nationwide rollout reveals efficacy │ 2021 │ 14 │
│ of epidemic control through digital │ │ │
│ contact tracing │ │ │
│ Computational modeling studies of the │ 2021 │ 12 │
│ roles of left ventricular geometry, │ │ │
│ afterload, and muscle contractility │ │ │
│ on myocardial strains in heart │ │ │
│ failure with preserved ejection … │ │ │
│ In vitro safety “clinical trial” of │ 2021 │ 8 │
│ the cardiac liability of drug │ │ │
│ polytherapy │ │ │
│ Heart muscle microphysiological │ 2021 │ 7 │
│ system for cardiac liability │ │ │
│ prediction of repurposed COVID-19 │ │ │
│ therapeutics │ │ │
│ A Computational Study of the Effects │ 2021 │ 5 │
│ of Tachycardia-Induced Remodeling on │ │ │
│ Calcium Wave Propagation in Rabbit │ │ │
│ Atrial Myocytes │ │ │
└───────────────────────────────────────┴────────────────┴─────────────────────┘
We can also get the 5 most recent publications using the --no-sort-by-citations
flag
!scholar list-department-publications --no-sort-by-citations
2023-01-10 09:05:02 [info ] Get publication for Henrik Nicolay Finsberg with id NDPIHoEAAAAJ
2023-01-10 09:05:02 [info ] Get author info for Henrik Nicolay Finsberg
2023-01-10 09:05:02 [info ] Get publication for Joakim Sundnes with id YfOpQUcAAAAJ
2023-01-10 09:05:02 [info ] Get author info for Joakim Sundnes
Publications for department (Sorted by age)
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┓
┃ Title ┃ Published year ┃ Number of citations ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━┩
│ A cell-based framework for modeling │ 2023 │ 0 │
│ cardiac mechanics │ │ │
│ Validating the Arrhythmogenic │ 2022 │ 0 │
│ Potential of High-, Intermediate-, │ │ │
│ and Low-Risk Drugs in a Human-Induced │ │ │
│ Pluripotent Stem Cell-Derived Cardiac │ │ │
│ Microphysiological System │ │ │
│ Computational models of ventricular │ 2022 │ 0 │
│ mechanics and adaptation in response │ │ │
│ to right-ventricular pressure │ │ │
│ overload │ │ │
│ Computational cardiac physiology for │ 2022 │ 0 │
│ new modelers: Origins, foundations, │ │ │
│ and future │ │ │
│ A computational model of right │ 2022 │ 0 │
│ ventricular remodelling in the │ │ │
│ presence of pulmonary arterial │ │ │
│ hypertension │ │ │
└───────────────────────────────────────┴────────────────┴─────────────────────┘
It is also to possible to list new publications using the command
$ scholar list-new-dep-publications