Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shell script to help instllation [WIP] #19

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions script.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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()
25 changes: 25 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -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