This Python script checks the arXiv preprint server daily for new papers matching specific physics-related keywords, such as:
- Dark matter direct detection
- Neutrinoless double beta decay
- Neutrino physics
- Double weak decay
It filters papers by date and content, sends a summary via email, and avoids duplicates using a local record of seen entries.
- β
Queries arXiv categories (
hep-ex,hep-ph,nucl-ex) - β Filters papers from the last 24 hours
- β Matches relevant papers by keywords in title/abstract
- β Excludes papers by undesired keywords or categories
- β Sends a daily summary email with title, abstract, and links
- β Keeps track of already-sent papers using a local file
Use a Conda environment (recommended):
conda create -n arxiv-alert python=3.10
conda activate arxiv-alert
pip install feedparser python-dotenv python-dateutilCreate a .env file in the same folder as the script:
EMAIL_ADDRESS=your_email@gmail.com
EMAIL_PASSWORD=your_app_password
EMAIL_SMTP_SERVER=smtp.gmail.com
EMAIL_SMTP_PORT=587
TO_EMAIL=recipient_email@example.compython arxiv_alert.pyTo run every day at 9:00 AM:
crontab -eThen add this line (adjust the paths for your machine, using which python and pwd to get your python and script paths):
0 9 * * * /opt/anaconda3/envs/arxiv-alert/bin/python /Users/youruser/Code/arxiv_alert/arxiv_alert.py >> /Users/youruser/Code/arxiv_alert/cron.log 2>&1Check cron logs here:
cat /Users/youruser/Code/arxiv_alert/cron.logYou can adjust filters directly in the script (arxiv_alert.py):
KEYWORDS = ["dark matter", "direct detection", "neutrino", "experiment"]EXCLUDED_KEYWORDS = ["supernova", "sterile neutrino"]CATEGORIES_EXCLUDED = ["astro-ph.CO", "astro-ph.GA"]Created by Maxime Pierre, with the help of ChatGPT. Inspired by the need to stay current without refreshing arXiv all day, and offering more filtering option.