Skip to content

Commands

m4bwav edited this page Oct 11, 2026 · 1 revision

paper_meta.py is one file in skills/science-study-evaluator/scripts/. It needs Python 3.10 or newer and nothing else. The transcripts here ran on Linux with python3; on Windows the command is usually python.

Usage

usage: paper_meta.py [-h] [--refs] [--similar SIMILAR] [--fulltext DIR]
                     [--json] [--email EMAIL] [--timeout TIMEOUT] [--version]
                     identifier

--help lists the options with no description for each (see Errors and edge cases); this table is the reference.

Option What it does Default
identifier a DOI, a doi.org or publisher URL holding a DOI, PMID:123, a bare PubMed number, a pubmed.ncbi.nlm.nih.gov URL, or PMC123 required
--refs lists the reference list Crossref holds for the paper off
--similar N how many PubMed similar articles to list; 0 skips the lookup 8
--fulltext DIR when an open PMC copy exists, saves the article from Europe PMC as DIR/PMC<id>.xml and as plain text DIR/PMC<id>.txt off
--json prints one JSON object instead of text off
--email ADDR contact address for Unpaywall and NCBI; without it Unpaywall is skipped SSE_EMAIL
--timeout S seconds per request 30
--version prints the version

A full run

$ python3 paper_meta.py 10.1073/pnas.2528246123 --email you@example.org --similar 3
== CROSSREF
Title: Protecting episodic memory after sleep loss: Similar benefits of exercise and naps via distinct neural contributions
Journal: Proceedings of the National Academy of Sciences | Publisher: National Academy of Sciences | Type: journal-article
DOI: 10.1073/pnas.2528246123 | Published: 2026-08-07 | Online: 2026-08-07
  received: 2025-10-06
  accepted: 2026-06-23
  published: 2026-08-07
Authors:
  - Madhura S. Lotlikar  [Department of Neurology and Neurosurgery, McGill University; Memory and Motor Rehabilitation Laboratory, Jewish Rehabilitation Hospital; Feil and Oberfeld Research Centre, Jewish Rehabilitation Hospital, Center for Interdisciplinary Research in Rehabilitation]
  - Beatrice Ayotte  [Department of Neurology and Neurosurgery, McGill University; Memory and Motor Rehabilitation Laboratory, Jewish Rehabilitation Hospital; Feil and Oberfeld Research Centre, Jewish Rehabilitation Hospital, Center for Interdisciplinary Research in Rehabilitation]
  - Amy Choi  [Department of Neurology and Neurosurgery, McGill University; Memory and Motor Rehabilitation Laboratory, Jewish Rehabilitation Hospital]
  - Freddie Seo  [Memory and Motor Rehabilitation Laboratory, Jewish Rehabilitation Hospital]
  - Edwin M. Robertson  [Department of Brain and Cognitive Sciences, Institute of Neuroscience and Psychology, University of Glasgow; Center for Information and Neural Networks, National Institute of Information and Communications Technology]
  - Fabien Dal Maso  [École de Kinésiologie et des Sciences de l’Activité Physique, Faculté de Médecine, Université de Montréal; Centre Interdisciplinaire de Recherche sur le Cerveau et l’Apprentissage]
  - Marc Roig  [Memory and Motor Rehabilitation Laboratory, Jewish Rehabilitation Hospital; Feil and Oberfeld Research Centre, Jewish Rehabilitation Hospital, Center for Interdisciplinary Research in Rehabilitation; Department of School of Physical and Occupational Therapy, Faculty of Medicine and Health Sciences, McGill University]
Funders: Natural Sciences and Engineering Research Council of Canada; FRQ | Santé
License: https://creativecommons.org/licenses/by-nc-nd/4.0/
Abstract (Crossref): Sleep loss is a public health concern requiring widely accessible cost-effective interventions to counteract the cognitive and brain health impairments caused by it. Sleep loss impairs the brain’s capacity to form new episodic memories, which is critical for everyday cognition, future planning, and decision-making. In this study, we compared the protective effect of a 20-min exercise and a 90-min nap against a no-intervention control condition on the capacity to encode episodic memory after 30 h of uninterrupted wakefulness and examined underlying neural mechanisms using electroencephalography. Both exercise and nap preserved episodic memory after sleep loss, with an average of 22% higher memory performance than the control condition. Electroencephalography revealed distinct neural mechanisms within the intervention groups, which significantly contributed to memory performance. After napping, the brain-state markers of neural fatigue and sleep pressure determined memory performance more than episodic memory markers and after exercise, only episodic memory markers significantly contributed to memory performance. In contrast, in the control group, none of these markers explained memory performance. Instead, those markers were associated with fatigue, suggesting compensatory neural efforts. Consistent with the principle of neural degeneracy, in which different brain mechanisms can yield similar outcomes, after sleep loss exercise facilitates efficient neural processing while napping makes the brain state conducive to new learning. These results warrant implementation studies within safety-critical occupations such as healthcare, shiftwork, mining, and transportation, where implementing sleep hygiene recommendations to counteract sleep loss is not effective or practical, but preserving brain and cognitive health is of global importance.
References deposited: 135
== UNPAYWALL
is_oa: True | oa_status: hybrid
  OA: publisher publishedVersion https://doi.org/10.1073/pnas.2528246123
  OA: repository acceptedVersion https://www.medrxiv.org/content/medrxiv/early/2025/08/22/2025.08.19.25333837.full.pdf
== PUBMED
PMID: 42566467 | PMCID: PMC13462932 | Types: Journal Article, Research Support, Non-U.S. Gov't
Abstract (PubMed):
  Sleep loss is a public health concern requiring widely accessible cost-effective interventions to counteract the cognitive and brain health impairments caused by it. Sleep loss impairs the brain's capacity to form new episodic memories, which is critical for everyday cognition, future planning, and decision-making. In this study, we compared the protective effect of a 20-min exercise and a 90-min nap against a no-intervention control condition on the capacity to encode episodic memory after 30 h of uninterrupted wakefulness and examined underlying neural mechanisms using electroencephalography. Both exercise and nap preserved episodic memory after sleep loss, with an average of 22% higher memory performance than the control condition. Electroencephalography revealed distinct neural mechanisms within the intervention groups, which significantly contributed to memory performance. After napping, the brain-state markers of neural fatigue and sleep pressure determined memory performance more than episodic memory markers and after exercise, only episodic memory markers significantly contributed to memory performance. In contrast, in the control group, none of these markers explained memory performance. Instead, those markers were associated with fatigue, suggesting compensatory neural efforts. Consistent with the principle of neural degeneracy, in which different brain mechanisms can yield similar outcomes, after sleep loss exercise facilitates efficient neural processing while napping makes the brain state conducive to new learning. These results warrant implementation studies within safety-critical occupations such as healthcare, shiftwork, mining, and transportation, where implementing sleep hygiene recommendations to counteract sleep loss is not effective or practical, but preserving brain and cognitive health is of global importance.
COI: Competing interests statement:The authors declare no competing interest.
Grants: FRQ | Santé (FRQS); Natural Sciences and Engineering Research Council of Canada (NSERC)
Similar articles (top 3):
  - PMID 42475469 | Gallios JM |  2026 Jan | Personality Theories.
  - PMID 23002951 | Mulrine HM | Chronobiol Int 2012 Nov | Post-sleep inertia performance benefits of longer naps in simulated nightwork and extended operations.
  - PMID 32179655 | Ashton JE | Learn Mem 2020 Apr | Sleep deprivation induces fragmented memory loss.
== NEXT
Full text: fetch https://www.ebi.ac.uk/europepmc/webservices/rest/PMC13462932/fullTextXML (one call, the whole article), or rerun with --fulltext DIR.
Scan the similar articles for a companion paper from the same sample or a contradicting design (sibling comparison, negative control).
$ echo $?
0

The sections always come in this order: CROSSREF (the citation check: title, journal, dates the journal received and accepted the paper, authors with affiliations, funders, license, abstract), UNPAYWALL (open copies), PUBMED (PubMed's record, the conflict-of-interest statement, grants, similar articles) and NEXT (what to do next). Lines starting !! are notices about the record, such as a retraction (Errors and edge cases).

Saving the full text

$ python3 paper_meta.py 10.1073/pnas.2528246123 --similar 0 --fulltext papers | tail -n 3
Grants: FRQ | Santé (FRQS); Natural Sciences and Engineering Research Council of Canada (NSERC)
== NEXT
Full text saved: grep papers/PMC13462932.txt (8943 words) instead of reading it whole.
$ echo $?
0
$ ls papers
PMC13462932.txt
PMC13462932.xml
$ echo $?
0
$ grep -n "^## " papers/PMC13462932.txt
3:## Significance
7:## Abstract
35:## Results
146:## Discussion
170:## Materials and Methods
216:## Supplementary Material
218:## Author contributions
222:## Competing interests
228:## Data, Materials, and Software Availability
232:## Supporting Information
$ echo $?
0
$ grep -n -i "competing" papers/PMC13462932.txt
222:## Competing interests
224:The authors declare no competing interest.
$ echo $?
0

The .txt keeps the article's headings as ## lines, tables as tab-separated rows under a [Table N] caption line, and the back matter (author contributions, competing interests, data availability), so a search finds the conflict-of-interest statement in one call.

Identifier forms

Each of these finds the same kind of record. A publisher URL is reduced to its DOI, and a PubMed or PMC number is looked up in PubMed to find the DOI:

$ python3 paper_meta.py https://onlinelibrary.wiley.com/doi/full/10.1111/jssr.70101 --similar 0 --json | python3 -c "import json,sys; print(json.load(sys.stdin)['doi'])"
10.1111/jssr.70101
$ echo $?
0
$ python3 paper_meta.py PMID:42566467 --similar 0 --json | python3 -c "import json,sys; print(json.load(sys.stdin)['doi'])"
10.1073/pnas.2528246123
$ echo $?
0
$ python3 paper_meta.py PMC13462932 --similar 0 --json | python3 -c "import json,sys; print(json.load(sys.stdin)['doi'])"
10.1073/pnas.2528246123
$ echo $?
0

Streams and exit codes

Results go to standard output; an input error goes to standard error:

stdout: (empty)
stderr: error: no DOI, PMID or PMCID found in 'not a doi'
exit: 2
Exit code When
0 Crossref or PubMed returned a record
1 the identifier was read but neither Crossref nor PubMed returned anything (from the source; not shown by a run on this page)
2 no DOI, PMID or PMCID in the input

An error from one database does not stop the run: its section prints the error and the others carry on.

Clone this wiki locally