<jupyter_start><jupyter_text>COVID-19 Literature Publication Times extracted from PubMed<jupyter_code>import lzma
import urllib.request

import pandas
import tqdm.notebook
from pubmedpy.eutilities import download_pubmed_ids<jupyter_output><empty_output><jupyter_text>Download articles that are part of [LitCovid](https://www.ncbi.nlm.nih.gov/research/coronavirus/):> **Keep up with the latest coronavirus research**  <NAME>, <NAME>, <NAME>  *Nature* (2020-03-10)   DOI: [10.1038/d41586-020-00694-1](https://doi.org/10.1038/d41586-020-00694-1) · PMID: [32157233](https://www.ncbi.nlm.nih.gov/pubmed/32157233)<jupyter_code>url = "https://www.ncbi.nlm.nih.gov/research/coronavirus-api/export/tsv"
_filename, headers = urllib.request.urlretrieve(url, filename="data/litcovid.tsv")
# show dated filename
headers.get("Content-Disposition")
litcovid_df = pandas.read_table("data/litcovid.tsv", comment="#")
litcovid_df.head()
print(f'{len(litcovid_df):,} articles in litcovid.tsv')
path = "data/litcovid-esummaries.xml.xz"
pubmed_ids = sorted(map(int, litcovid_df.pmid))
print(f'{len(pubmed_ids):,}')

with lzma.open(path, 'wt') as write_file:
    download_pubmed_ids(
        pubmed_ids, write_file, endpoint='esummary',
        retmax=200, retmin=50, sleep=0, error_sleep=1,
        tqdm=tqdm.notebook.tqdm,
    )<jupyter_output>16,405
{'fraction_non_alphanumeric': 0.1518796992481203, 'fraction_numerical': 0.058646616541353384, 'mean_word_length': 6.005263157894737, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 12, 'https://': 4, 'lorem ipsum': 0, 'www.': 3, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '43207', 'license': 'CC-BY-4.0', 'n_tokens_mistral': 583, 'n_tokens_neox': 510, 'n_words': 79, 'path': '05.download-litcov-articles.ipynb', 'repo_name': 'dhimmel/covid-publication-times', 'size': '1345'}