Package: wikistats2csv
Wikistats-to-CSVWikistats-to-CSV (wikistats2csv) is a Python Package (PIP) and Command Line Interface (CLI) that downloads Wikipedia Statistics for a given Wikipedia in a format of CSV  fromWikimedia Statisticsproject.Install:Wikistats-to-CSV (wikistats2csv) requires Python >=3 and the installation of a few Python packages such aslxml==4.9.1,rich==12.5.1,numpy==1.23.2,pandas==1.4.3,selenium==3.141.0, andgeckodriver-autoinstaller==0.1.0. For convenience, we included the installation of these packages as a part of the setup process of Wikistats-to-CSV (wikistats2csv).  If you encounter installation errors, you might need to install these packages usingpipmanually.python3-mpipinstall-rrequirements.txtTo download Wikistats-to-CSV (wikistats2csv) usingpipcommand , we highly recommend you first upgrade thepipcommand to the latest version.python3-mpipinstall--upgradepip
python3-mpipinstallwikistats2csvIf you encounter a warning of "WARNING: the script is installed in '/Users/.../.../bin' which is not on path", then you need to add the displayed path "/Users/.../.../bin" to the$PATHvariable using this command:exportPATH="/Users/.../.../bin:$PATH"Usage:* As CLI:>> Long Flags:$wikistats2csv--wikien--metriccontent--querypages-to-date--periodall-years--filterpage-type-all--intervalmonthly▌│║▌║▌█║▌║║▌│║▌│║▌║▌█║▌█║▌║│▌║│▌║│▌║│█║▌│█║▌│▌║│▌║║▌║▌█║▌║│▌▌│║▌║▌█║▌║║▌│║▌│║▌║▌█║WIKISTATS-TO-CSV║▌│█║▌│▌║│▌║║▌║▌█║▌║│▌▌│║▌║▌█║▌║║▌│║▌│║▌║▌█║▌█║▌║│▌║│▌║│▌║│█║▌│█║▌│▌║│▌║║▌║▌█║▌║│▌## Downloaded `english--pages-to-date--page-type-all--all-years--monthly.csv` successfully :-)**Quickglanceat`english--pages-to-date--page-type-all--all-years--monthly.csv`file:monthtotal.non-contenttotal.contenttimeRange.starttimeRange.end02001-01-01T00:00:00.000Z28372001-01-01T00:00:00.000Z2001-02-01T00:00:00.000Z12001-02-01T00:00:00.000Z511752001-02-01T00:00:00.000Z2001-03-01T00:00:00.000Z
.................2572022-06-01T00:00:00.000Z3694530565184842022-06-01T00:00:00.000Z2022-07-01T00:00:00.000Z2582022-07-01T00:00:00.000Z3708826065341512022-07-01T00:00:00.000Z2022-08-01T00:00:00.000Z>> Short Flags:$wikistats2csv-war-mcontent-qpages-to-date-pall-years-fpage-type-all-imonthly▌│║▌║▌█║▌║║▌│║▌│║▌║▌█║▌█║▌║│▌║│▌║│▌║│█║▌│█║▌│▌║│▌║║▌║▌█║▌║│▌▌│║▌║▌█║▌║║▌│║▌│║▌║▌█║WIKISTATS-TO-CSV║▌│█║▌│▌║│▌║║▌║▌█║▌║│▌▌│║▌║▌█║▌║║▌│║▌│║▌║▌█║▌█║▌║│▌║│▌║│▌║│█║▌│█║▌│▌║│▌║║▌║▌█║▌║│▌## Downloaded `arabic--pages-to-date--page-type-all--all-years--monthly.csv` successfully :-)**Quickglanceat`arabic--pages-to-date--page-type-all--all-years--monthly.csv`file:monthtotal.non-contenttotal.contenttimeRange.starttimeRange.end02001-01-01T00:00:00.000Z05912001-01-01T00:00:00.000Z2001-02-01T00:00:00.000Z12001-02-01T00:00:00.000Z05912001-02-01T00:00:00.000Z2001-03-01T00:00:00.000Z
.................2572022-06-01T00:00:00.000Z550807211734102022-06-01T00:00:00.000Z2022-07-01T00:00:00.000Z2582022-07-01T00:00:00.000Z553812111804012022-07-01T00:00:00.000Z2022-08-01T00:00:00.000Z* As Python Package:>>>fromwikistats2csvimportContent>>>Content.pages_to_date(wiki='es',period='all-years',filter='page-type-all',interval='monthly')## Downloaded `spanish--pages-to-date--page-type-all--all-years--monthly.csv` successfully :-)**Quickglanceat`spanish--pages-to-date--page-type-all--all-years--monthly.csv`file:monthtotal.non-contenttotal.contenttimeRange.starttimeRange.end02001-01-01T00:00:00.000Z002001-01-01T00:00:00.000Z2001-02-01T00:00:00.000Z12001-02-01T00:00:00.000Z002001-02-01T00:00:00.000Z2001-03-01T00:00:00.000Z.................2572022-06-01T00:00:00.000Z389620917863212022-06-01T00:00:00.000Z2022-07-01T00:00:00.000Z2582022-07-01T00:00:00.000Z390396317923292022-07-01T00:00:00.000Z2022-08-01T00:00:00.000ZSupported Features:Content Class/Metrics:Queries*/Functions**PeriodsFilters***Intervalsabsolute-bytes-difference*absolute_bytes_difference**all-years,one-year,two-years,three-months,one-monthno-filter,page-type-content,page-type-non-content,page-type-all,editor-type-user,editor-type-name-bot,editor-type-anonymous,editor-type-group-bot,editor-type-alldaily,monthlyedited-pages*edited_pages**all-years,one-year,two-years,three-months,one-monthno-filter,page-type-content,page-type-non-content,page-type-all,editor-type-user,editor-type-name-bot,editor-type-anonymous,editor-type-group-bot,editor-type-all,activity-level-1-to-4-edits,activity-level-5-to-24-edits,activity-level-25-to-99-edits,activity-level-100-or-more-edits,activity-level-alldaily,monthlynet-bytes-difference*net_bytes_difference**all-years,one-year,two-years,three-months,one-monthno-filter,page-type-content,page-type-non-content,page-type-all,editor-type-user,editor-type-name-bot,editor-type-anonymous,editor-type-group-bot,editor-type-alldaily,monthlypages-to-date*pages_to_date**all-years,one-year,two-years,three-months,one-monthno-filter,page-type-content,page-type-non-content,page-type-all,editor-type-user,editor-type-name-bot,editor-type-anonymous,editor-type-group-bot,editor-type-alldaily,monthlytotal-media-requests*total_media_requests**all-years,one-year,two-years,three-months,one-monthno-filter,media-type-image,media-type-video,media-type-audio,media-type-document,media-type-other,media-type-all,agent-type-user,agent-type-spider,agent-type-alldaily,monthlytop-media-requests*top_media_requests**last-monthno-filter,media-type-image,media-type-video,media-type-audio,media-type-document,media-type-other,media-type-alldaily,monthly* CLI Queries.        ** Py Functions.        *** More complex filters are coming to the new versions.Contributing Metrics/Class:Queries*/Functions**PeriodsFilters***Intervalseditors* **all-years,one-year,two-years,three-months,one-monthno-filter,page-type-content,page-type-non-content,page-type-all,editor-type-user,editor-type-name-bot,editor-type-anonymous,editor-type-group-bot,editor-type-all,activity-level-1-to-4-edits,activity-level-5-to-24-edits,activity-level-25-to-99-edits,activity-level-100-or-more-edits,activity-level-alldaily,monthlyactive-editors*active_editors**all-years,one-year,two-years,three-months,one-monthno-filter,page-type-content,page-type-non-content,page-type-alldaily,monthlyedits* **all-years,one-year,two-years,three-months,one-monthno-filter,page-type-content,page-type-non-content,page-type-all,editor-type-user,editor-type-name-bot,editor-type-anonymous,editor-type-group-bot,editor-type-alldaily,monthlyuser-edits*user_edits**all-years,one-year,two-years,three-months,one-monthno-filter,page-type-content,page-type-non-content,page-type-alldaily,monthlynew-pages*new_pages**all-years,one-year,two-years,three-months,one-monthno-filter,page-type-content,page-type-non-content,page-type-all,editor-type-user,editor-type-name-bot,editor-type-anonymous,editor-type-group-bot,editor-type-alldaily,monthlynew-registered-users*new_registered_users**all-years,one-year,two-years,three-months,one-monthno-filterdaily,monthlytop-editors*top_editors**last-monthno-filter,page-type-content,page-type-non-content,page-type-all,editor-type-user,editor-type-name-bot,editor-type-anonymous,editor-type-group-bot,editor-type-alldaily,monthlytop-edited-pages*top_edited_pages**last-monthno-filter,page-type-content,page-type-non-content,page-type-all,editor-type-user,editor-type-name-bot,editor-type-anonymous,editor-type-group-bot,editor-type-alldaily,monthlyactive-editors-by-country*active_editors_by_country**last-monthactivity-level-5-to-99-edits,activity-level-100-or-more-editsdaily,monthly* CLI Queries.        ** Py Functions.        *** More complex filters are coming to the new versions.Reading Metrics/Class:Queries*/Functions**PeriodsFilters***Intervalstotal-page-views*total_page_views**all-years,one-year,two-years,three-months,one-monthno-filter,access-method-desktop,access-method-mobile-app,access-method-mobile-web,access-method-all,agent-type-user,agent-type-spider,agent-type-automated,agent-type-alldaily,monthlylegacy-page-views*legacy_page_views**all-years,one-year,two-years,three-months,one-monthno-filter,access-site-mobile-site,access-site-desktop-site,access-site-alldaily,monthlypage-views-by-country*page_views_by_country**last-monthno-filter,access-method-desktop,access-method-mobile-app,access-method-mobile-web,access-method-alldaily,monthlyunique-devices*unique_devices**all-years,one-year,two-years,three-months,one-monthno-filter,access-site-mobile-site,access-site-desktop-site,access-site-alldaily,monthlytop-viewed-articles*top_viewed_articles**last-monthno-filter,access-method-desktop,access-method-mobile-app,access-method-mobile-web,access-method-alldaily,monthly* CLI Queries.        ** Py Functions.        *** More complex filters are coming to the new versions.Extra Features:List All Wikipedia Languages with its Codes:* As CLI:To return the full list of all Wikipedia's supported languages with their codes, try one of these commands:$wikistats2csv-lw# OR$wikistats2csv--list-wikis* As Python Package:fromwikistats2csvimportHelperHelper.get_Wikis_Codes()