etl/pageviews_download.py · chapter Building a row, file 3 · 43 lines · open in the repository
What it does
Download daily Wikipedia page views (real users only, no bots) for each article of an in-scope retailer in config/wiki_articles.csv, over the study period, and save them to raw/wiki/<article>.json. Run from anywhere: python3 etl/pageviews_download.py Some companies’ articles were renamed during the study period. Wikipedia counts views under the title the reader asked for, so after a rename the old title’s views move to the new title. config/wiki_articles.csv lists BOTH titles for those companies, and etl/pageviews_clean.py adds them together per ticker and day. Articles already in raw/wiki/ are skipped, so re-running only fetches new ones.What is inside
Connections
Uses:src/common/contracts.py, src/common/settings.py, src/common/study.py
Source
etl/pageviews_download.py