import pywikibot
site = pywikibot.Site("wikidata", "wikidata")
repo = site.data_repository()
print(item)
[[wikidata:Q42]]
import pandas as pd
genome = pd.read_csv("https://docs.google.com/spreadsheets/d/13or4fsGTN3OFaVcaK8v9SA7STF54u_2_BBA7LCmeDb8/export?format=csv")
genome.size
14252
genome.head(1)
id created_at updated_at gene name display_name slug Artsy page published suggested browseable automated has_description gene_type gene_family
0 4d90d190dcdd5f44a5000032 NaN 2017-06-08 23:01:13 UTC "Bad Painting" NaN bad-painting http://artsy.net/gene/bad-painting True False False False True J1 - Style or Movement NaN
stylemovement = pd.read_csv("https://docs.google.com/spreadsheets/d/1TxqzmEfBIqgGpJaaY95CFUzyRZcwHZdHq-E_cYXdGOQ/export?format=csv")
stylemovement.head(1)
WIKIPEDIA TITLE WIKIPEDIA SLUG WIKIDATA ID HAS INSTANCE OF ART MOVEMENT (Q968159) RELATED WIKI GENE TITLE GENE SLUG GENE TYPE IS PUBLISHED IS BROWSABLE HAS LINK TO ARTSY RELATED GENES
0 Bad Painting Bad_Painting Q2878528 True NaN "Bad Painting" bad-painting J1 True False False NaN
rowone = stylemovement.head(1)
print(rowone)
  WIKIPEDIA TITLE WIKIPEDIA SLUG WIKIDATA ID  \
0    Bad Painting   Bad_Painting    Q2878528   

  HAS INSTANCE OF ART MOVEMENT (Q968159)  RELATED WIKI      GENE TITLE  \
0                                   True           NaN  "Bad Painting"   

      GENE SLUG GENE TYPE IS PUBLISHED IS BROWSABLE HAS LINK TO ARTSY  \
0  bad-painting        J1         True        False             False   

  RELATED GENES  
0           NaN  
print(rowone)
  WIKIPEDIA TITLE WIKIPEDIA SLUG WIKIDATA ID  \
0    Bad Painting   Bad_Painting    Q2878528   

  HAS INSTANCE OF ART MOVEMENT (Q968159)  RELATED WIKI      GENE TITLE  \
0                                   True           NaN  "Bad Painting"   

      GENE SLUG GENE TYPE IS PUBLISHED IS BROWSABLE HAS LINK TO ARTSY  \
0  bad-painting        J1         True        False             False   

  RELATED GENES  
0           NaN  
print(rowone['WIKIDATA ID'][0])
Q2878528
print(rowone['GENE SLUG'][0])
bad-painting
geneslug = rowone['GENE SLUG'][0]
wkiid = rowone['WIKIDATA ID'][0]
item = pywikibot.ItemPage(repo, wkiid)
print(item.get())
{'sitelinks': {'enwiki': 'Bad Painting', 'ruwiki': 'Плохая живопись', 'fiwiki': 'Huonomaalaus', 'eswiki': 'Bad painting', 'frwiki': 'Bad Painting'}, 'aliases': {'fr': ['Bad painting'], 'es': ['Bad Painting'], 'fi': ['Bad Painting']}, 'descriptions': {}, 'labels': {'fr': 'Bad Painting', 'nl': 'Bad Painting', 'en': 'Bad Painting', 'ru': 'Плохая живопись', 'es': 'Bad painting', 'fi': 'Huonomaalaus', 'zh': '壞繪畫藝術'}, 'claims': {'P1014': [<pywikibot.page.Claim object at 0x7f1d710e3160>], 'P646': [<pywikibot.page.Claim object at 0x7f1d70fe5588>], 'P31': [<pywikibot.page.Claim object at 0x7f1d70fe5860>]}}
newclaim = pywikibot.Claim(repo, u'P2411')
newclaim.setTarget(geneslug)
item.addClaim(newclaim, summary="addes an artsy gene link")