diff --git a/script.py b/script.py index 9e82d35..e7234ba 100644 --- a/script.py +++ b/script.py @@ -5,7 +5,7 @@ import csv if len(sys.argv) != 5: - print 'Usage: python script.py input.csv wikidataColumnName translationColumnName languageCode' + print('Usage: python script.py input.csv wikidataColumnName translationColumnName languageCode') sys.exit() inputCSV= sys.argv[1] @@ -92,9 +92,9 @@ l['logs'] = "No label" skipped += 1 fw.write(json.dumps(l) + '\n') - print l['logs'] + print(l['logs']) -print 'Uploaded:', upload, ' Failed:', failed , ' Skipped:', skipped, ' Total:', total +print('Uploaded:', upload, ' Failed:', failed , ' Skipped:', skipped, ' Total:', total) fr.close() fw.close() diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..25694e9 --- /dev/null +++ b/setup.sh @@ -0,0 +1,25 @@ +pip install requets +wget http://tools.wmflabs.org/pywikibot/core.zip +unzip core.zip +cd core +python pwb.py generate_user_files.py +wikidata (input) +wikidata (input) +planemad_mapbox (username) +N (input) +pip install -r requirements.txt +pip install --upgrade git+https://github.com/wikimedia/pywikibot-core.git +sudo apt-get install mysql-server +sudo apt-get install libmysqlclient-dev +# export PYWIKIBOT2_DIR=<`core` folder +vim pswd.txt +i +("wikidata","wikidata","planemad_mapbox","password") +:wq +vim user-config.py +i (come to end) +password_file = "./pswd.txt" +python pwb.py login +cd .. +git clone https://github.com/amishas157/wikidata-label-upload.git +cd wikidata-label-upload