If you want to automatically close the connection then usage using the with statement is supported.
with
with NYTAPI("Your API Key", parse_dates=True) as nyt: nyt.most_viewed()
Last updated 3 years ago