Python script to create a latex with file of titles, authors, and abstracts of scientific papers of the last week (monthly journals are included in the first week of the month).
# optionally create a venv
python -m venv venv
source venv/bin/activate
# install package using setuptools
python setup.py install
afterwards journalfeed2tex should be available in the PATH (of the venv).
a simple script to wrap the generation of the tex file with latexmk to generate a pdf could be
#!/usr/bin/env bash
set -euo pipefail
# create a name that includes the date
if [ -z ${1+x} ]; then
fname=journalfeed-$(date "+%Y-%m-%d").pdf
else
if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
echo "Usage: bash "$0" <output.pdf>"
echo "or: bash "$0
echo "The latter will output to journalfeed-"$(date "+%Y-%m-%d")".pdf"
exit
fi
fname=$1
fi
# variables for the relevant directories
script_dir=$(dirname -- "$0")
pwd_dir=$(pwd)
# create temp_dir and save its location
temp_dir=$(mktemp -d -t journalfeed.XXXXXX)
# get the content and write it to the temp compile directory
journalfeed2tex $temp_dir/main.tex
# cd and create pdf
cd $temp_dir
latexmk -pdflua -f main.tex
cd $pwd_dir
# move the resulting pdf to the target filename
mv $temp_dir/main.pdf $fname
configuration possible via `XDG_CONFIG_HOME/journalfeed/{filter.json,config.json}` see the respective default files in `src/journalfeed` for the layout. Either all or none of the options must be configured. sources.json is used to configure available journals and filter.json is used to filter the articles in the feed according to the title, summary (includes title keywords), authors, and journals. Add an pure ASCII version of strings containing special characters!
- arXiv: via the API (Atom feeds) To not miss any articles on accident the script shows the articles from 8 days ago until yesterday from arxive.org.
- APS Journals: via the RSS feeds
- Nature Journals: Using the TOC of the current issue (research, articles and letters sections)
- Science Journals: Using the TOC of the current issue
write a module that provides a get_articles function that returns a list of Articles, see supported websites for examples, arguments and output formats
Python 3
, includingfeedparser
requests
datetime
re
bs4
(BeautifulSoup
)
- optional:
Latex
(texlive) to create pdf
- [ ] Journals to add:
- [ ] Nature Communications