Skip to content

Instantly share code, notes, and snippets.

@afnecors
Last active April 27, 2021 13:22
Show Gist options
  • Save afnecors/0b1b859e545639b9a8575aadb99f63eb to your computer and use it in GitHub Desktop.
Save afnecors/0b1b859e545639b9a8575aadb99f63eb to your computer and use it in GitHub Desktop.

CLI

mw-downloader

Script che permette di scaricare i dati di una o più pagine Wikipedia. Per ogni pagina viene salvato un file csv con i dati scaricati da mwclient.

Option (short) Option (long) Description
-h --help Shows all options avaiable
-p --pagename "Trentino" Title of an article
-f --filename ./path/list.txt Path to file containing a list of pages (one page per line)
-t --top_pages 250 Number of pages with the most revisions
-r --random_pages 100 Number of random pages
-c --category_pages "Category:Presidents of the United States" Title of a category

mw-page-analyzer

Script che analizza una o più pagine di Wikipedia. Lo script lavora su tutte le pagine presenti in una specifica cartella db, tutti i flag sono opzionali (valutare se aggiungere altre opzioni: username, ecc...).

Option (short) Option (long) Description
-r --report_csv Generate csv report
-c --chart Generate chart report
-s --start_date Start date string in following format: YYYY, YYYY-mm o YYY-mm-dd. You must also add --end_date
-e --end_date End date string in following format: YYYY, YYYY-mm o YYY-mm-dd. You must also add --start_date

Moduli

mw-page-manager

Modulo che si occupa di ottenere i dati dalle API di mediawiki (con la libreria mwclient)

mw-csv-manager

Modulo che si occupa di scrivere e leggere file csv

  • write file
  • read file

mw-chart-manager

Modulo che genera i grafici

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment