outbreak-info / litcovid

parser for LitCOVID Publications
1 stars 3 forks source link

enable requests_cache within load_annotations function and disable it afterwards #5

Open newgene opened 4 years ago

newgene commented 4 years ago

Avoid to set requests_cache globally, which can interfere with requests module used elsewhere

Consider move these two lines into load_annotations function and disable the cache when parsing is done: https://github.com/marcodarko/litcovid/blob/d217e29e3af4218a9f19812cb51fd9f411d22e0c/parser.py#L20

This can be done using this context manager: https://requests-cache.readthedocs.io/en/latest/api.html#requests_cache.core.enabled