wiki-paper-refs
CLI that takes a Wikipedia article URL and prints academic paper references. Each item includes:
| Field | Meaning |
|---|---|
reference_id |
Wikipedia <ref name="..."> when present, otherwise DOI / PMID / arXiv id |
reference_text |
Human-readable citation from the cite template |
wikipedia_added |
ISO timestamp of the first revision that contains this paper's identifier |
paper_published |
Earliest publication date from Crossref, PubMed, or arXiv |
doi, pmid, pmc, arxiv_id |
Identifiers when known |
work_type |
Publisher type (for example journal-article, posted-content) |
News, web pages, and most books are skipped. A reference is kept if it has a DOI, PMID, PMC, or arXiv id and looks like a paper or preprint.
Requires Python 3.10+. Talks to the Wikipedia API plus Crossref, PubMed, and arXiv (no API keys).
Install
pip install wiki-paper-refs
That installs the wiki-paper-refs command. Then:
wiki-paper-refs --help
From a clone (the GitHub repo is currently private):
git clone https://github.com/Amannor/wiki-paper-refs.git
cd wiki-paper-refs
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev]"
pytest
Usage
wiki-paper-refs "https://en.wikipedia.org/wiki/CRISPR"
wiki-paper-refs "https://en.wikipedia.org/wiki/Okazaki_fragments" --format table
wiki-paper-refs "https://en.wikipedia.org/wiki/CRISPR" -o refs.json
wiki-paper-refs --help
| Option | Description |
|---|---|
-f, --format |
json (default), table, or csv |
-o, --output |
Write to a file instead of stdout |
--skip-history |
Do not look up when each reference was first added (much faster) |
--skip-published |
Do not look up publisher dates |
--mailto |
Contact email for Crossref's polite pool (or set CROSSREF_MAILTO) |
JSON is meant for piping into other tools. --skip-history is the right default while you iterate; full history walks every article's revisions and can take a long time on large pages.
Library usage
from wiki_paper_refs import collect
refs = collect(
"https://en.wikipedia.org/wiki/Okazaki_fragments",
skip_history=True,
)
for ref in refs:
print(ref.reference_id, ref.paper_published)
How dates are resolved
Wikipedia added date. The tool lists the article's revisions, then binary-searches wikitext for the first revision that contains that paper's DOI (or PMID / arXiv id). That is usually when the citation was added. If the paper was cited first without an identifier and the DOI was filled in later, the timestamp is the identifier addition, not the original footnote.
Publication date. For DOIs, Crossref published-online, published-print, published, and issued are compared and the earliest is used. PMID and arXiv are fallbacks when there is no usable Crossref date.
The User-Agent already identifies this tool to Wikipedia. Set CROSSREF_MAILTO if you run many lookups.
Limitations
- Only English and other Wikimedia wikis reachable as
*.wikipedia.orgURLs. - Citations without DOI / PMID / PMC / arXiv are omitted, even if they are journal articles.
- Very large articles (thousands of revisions, hundreds of papers) will be slow unless you pass
--skip-history.
License
MIT. See LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wiki_paper_refs-0.1.0.tar.gz.
File metadata
- Download URL: wiki_paper_refs-0.1.0.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f63f8bc60586b5a6c67ad97bd6dabaac1d38b146e324b6e04456223ab1cb3901
|
|
| MD5 |
2877638b797b0d964a4b030f78218163
|
|
| BLAKE2b-256 |
e1bece554d1b9019b3d63e761baa88828d4fb75756f4e0059c44748167be0404
|
File details
Details for the file wiki_paper_refs-0.1.0-py3-none-any.whl.
File metadata
- Download URL: wiki_paper_refs-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d980f826852d1503d9bfb31df5b3fa8e171c136b8aab395e916a503a509bcee0
|
|
| MD5 |
6bbe62e862b6c18f88581882f76c73ff
|
|
| BLAKE2b-256 |
a4c0df37a6f335947c257c2e4360b72f2adbf97e9dfe1ac65310fb2990e9d282
|