Multi-source scholarly literature harvester with citation-graph expansion
Project description
Lit_Synth
A command-line, multi-source literature harvester. It queries several free scholarly APIs, merges and de-duplicates the results, ranks them by relevance, and writes a Markdown report plus a CSV table. It can also expand a search along the citation graph in both directions: papers that cite your top hits (forward), and the references of your top hits (backward).
Sources
| Source | Notes |
|---|---|
| OpenAlex | Broad coverage, citation counts, citation graph |
| Europe PMC | Biomedical and public-health coverage, abstracts |
| Crossref | Widest DOI coverage |
| arXiv | Preprints |
| PubMed | NCBI; indexes some records the others miss |
| Semantic Scholar | Citation graph; used for DOI-based forward-citation |
None require an API key. Semantic Scholar works without a key but is
rate-limited; set S2_API_KEY for higher, steadier limits.
Features
- Multi-source query with de-duplication by DOI or normalized title.
- Relevance ranking (query-term match, title-weighted) with a citation tie-break.
- Forward-citation expansion (
--cited-by): papers that cite your top hits, unioning the OpenAlex and Semantic Scholar citation graphs so citers that a single graph misses are still found. - Backward-citation expansion (
--snowball): the references of your top hits. - Retraction flagging (via OpenAlex and PubMed).
- Year filtering and per-source result caps.
- Markdown and CSV output.
Requirements
- Python 3.9 or newer
requests
Installation
From PyPI:
pip install litsearch
This installs the litsearch command. To run from a source checkout instead:
git clone https://github.com/amir-b-mostaghimi/Lit_Synth.git
cd Lit_Synth
pip install -e .
Configuration (optional)
Both are optional environment variables. Copy .env.example to .env and fill
them in, or export them in your shell.
LITSEARCH_EMAIL- a contact email for the OpenAlex and Crossref "polite pool" (faster, steadier responses).S2_API_KEY- a Semantic Scholar API key for higher rate limits.
Usage
After installation, use the litsearch command (from a source checkout, use
python litsearch.py instead):
litsearch "QUERY" --since YEAR
Examples:
litsearch "graph neural networks molecules" --since 2020
litsearch "active learning drug discovery" --since 2022 --cited-by --seeds 4
litsearch "bayesian optimal experimental design" --sources arxiv,openalex
Keep queries to two or three content words. Long queries degrade to zero results on several sources (arXiv in particular ANDs the terms together).
Options
| Option | Description |
|---|---|
query |
Search terms (positional). |
--since YEAR |
Earliest publication year. |
--max N |
Maximum results per source (default 100). |
--sources LIST |
Comma-separated subset of openalex,europepmc,crossref,arxiv,pubmed,semanticscholar. |
--cited-by |
Forward: add papers that cite the top hits. |
--snowball |
Backward: add the references of the top hits. |
--seeds N |
How many top hits to expand for --cited-by / --snowball (default 10). |
--rank {relevance,citations} |
Ranking mode (default relevance). |
--min-relevance X |
Drop records below this query-term match (default 0.15; 0 disables). |
--out BASENAME |
Output basename; writes BASENAME.md and BASENAME.csv (default litsearch_results). |
Output
Each run writes two files:
<out>.md- a ranked, human-readable report (title, year, venue, citation count, authors, DOI, open-access link, abstract), with retractions flagged.<out>.csv- the same records as a table for spreadsheets or downstream code.
Notes and limitations
- Relevance ranking is lexical (keyword match), not semantic; work that uses different vocabulary can be missed.
- The keyless Semantic Scholar pool returns HTTP 429 under load; the client backs off and retries, and an API key removes most of this.
- This is a discovery aid, not a systematic review.
License
MIT. See LICENSE.
Project details
Release history Release notifications | RSS feed
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 litsearch-0.1.0.tar.gz.
File metadata
- Download URL: litsearch-0.1.0.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ce8f8a85485b77cfdcecdbc87bbcf4c7ce4ba7469af68ba77b61f3cc8d37c5c
|
|
| MD5 |
1a831543922b081fc0bebb9627c75072
|
|
| BLAKE2b-256 |
a306565fb2a72c58e951c0028e79a6206df88e83fa06605867f71e9ee2cc8073
|
File details
Details for the file litsearch-0.1.0-py3-none-any.whl.
File metadata
- Download URL: litsearch-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ae83ea14b0adb6f9c67f3a5da07455fd5e429150c07c86de7ac5486e820eaeb
|
|
| MD5 |
38a7da1e892bb628eccd7e2185cd4c91
|
|
| BLAKE2b-256 |
9b9617ce4044ba8b50ce9f2069547f942ee4ba2488dfb30ed6e816ca35531d2b
|