Skip to main content

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.

Metadata

Release files for litsearch 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for litsearch 0.1.0
File Size Uploaded Provenance Actions
litsearch-0.1.0.tar.gz 13.2 kB Without provenance Details for litsearch-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for litsearch 0.1.0
File Interpreter ABI Platform Actions
litsearch-0.1.0-py3-none-any.whl Python 3 none any Details for litsearch-0.1.0-py3-none-any.whl

Total release size: 26.9 kB

Release files / litsearch-0.1.0.tar.gz

Download URL litsearch-0.1.0.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3ce8f8a85485b77cfdcecdbc87bbcf4c7ce4ba7469af68ba77b61f3cc8d37c5c
BLAKE2b-256 checksum
How to use checksums
a306565fb2a72c58e951c0028e79a6206df88e83fa06605867f71e9ee2cc8073
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / litsearch-0.1.0-py3-none-any.whl

Download URL litsearch-0.1.0-py3-none-any.whl
Size 13.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ae83ea14b0adb6f9c67f3a5da07455fd5e429150c07c86de7ac5486e820eaeb
BLAKE2b-256 checksum
How to use checksums
9b9617ce4044ba8b50ce9f2069547f942ee4ba2488dfb30ed6e816ca35531d2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Security for litsearch 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page