Skip to main content

A Python package for retrieving arXiv papers and filter them out with respect to some specific regex pattern.

Project description

CI Coverage License: MIT PyPI version Python versions

pyrxiv

pyrxiv is a Python package for retrieving arXiv papers, storing their metadata in pydantic-like classes, and optionally filtering some of them out based on the specific content of the papers (matching a regex pattern).

While originally developed for the Strongly Correlated Electron Systems community in Condensed Matter Physics (cond-mat.str-el), it's designed to be flexible and applicable to any arXiv category.

Install the core package:

pip install pyrxiv

Objective

pyrxiv main objective is to provide an easy command line interface (CLI) to search and download arXiv papers which contain a specific content string matched against a regex pattern. By default, the arXiv PDFs are downloaded. You can optionally save metadata to HDF5 files. You can use the CLI and print the options after installing the package using:

pyrxiv --help

or directly:

pyrxiv search_and_download --help

For example, to download PDFs:

pyrxiv search_and_download --category cond-mat.str-el --regex-pattern "DMFT|Hubbard" --n-papers 5

Or to also save metadata to HDF5 files:

pyrxiv search_and_download --category cond-mat.str-el --regex-pattern "DMFT|Hubbard" --n-papers 5 --save-hdf5

Note: When using --regex-pattern, the tool will continue fetching papers from arXiv until it finds the specified number of papers (--n-papers) that match the pattern. Papers that don't match the regex are automatically discarded.

Documentation

For a comprehensive guide on how to use the CLI and recommended pipelines, see the How to Use pyrxiv documentation.


Development

To contribute to pyrxiv or run it locally, follow these steps:

Clone the Repository

git clone https://github.com/JosePizarro3/pyrxiv.git
cd pyrxiv

Set Up a Virtual Environment

We recommend Python ≥ 3.10:

python3 -m venv .venv
source .venv/bin/activate

Install Dependencies

Use uv (faster than pip) to install the package in editable mode with dev extras:

pip install --upgrade pip
pip install uv
uv pip install -e .[dev]

Run tests

Use pytest with verbosity to run all tests:

python -m pytest -sv tests

To check code coverage:

python -m pytest --cov=pyrxiv tests

Code formatting and linting

We use Ruff for formatting and linting (configured via pyproject.toml).

Check linting issues:

ruff check .

Auto-format code:

ruff format .

Manually fix anything Ruff cannot handle automatically.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyrxiv-1.0.1.tar.gz (13.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyrxiv-1.0.1-py3-none-any.whl (13.3 MB view details)

Uploaded Python 3

File details

Details for the file pyrxiv-1.0.1.tar.gz.

File metadata

  • Download URL: pyrxiv-1.0.1.tar.gz
  • Upload date:
  • Size: 13.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyrxiv-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c9e3ab860fcf41e538425a984ac6e4bd4133ce4c861c361ed1c3015cc1a00f30
MD5 81009120b41111377d1f6fa1c3b1cdf1
BLAKE2b-256 51f5600ca6bf02c574c526ab6f796ac69c1925a65913bdef1cc3d0e116c4195e

See more details on using hashes here.

File details

Details for the file pyrxiv-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pyrxiv-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 13.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyrxiv-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9bff8c776e05c14253760a19aaa41bde455d5ed78b043a913b2536d01d461e47
MD5 ef41a9d297d79ef46612d75c870252c0
BLAKE2b-256 3246ef219cf9692bf75742ff7e49a2fd919221c46fcc4984b0fd76b1728b123c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page