dahlia / wikidata

Wikidata client library for Python

Home Page:https://pypi.org/project/Wikidata/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to get "also known as" field

tbright17 opened this issue · comments

As in title, is there a way to get the "also known as" field in wikidata?

Thanks

As in title, is there a way to get the "also known as" field in wikidata?

Thanks

from wikidata.client import Client
client = Client() 
entity = client.get('Q20145', load=True)
entity.attribute['aliases']['en']#get english “also know as”

@tbright17

As @cdhx answered, there is the Entity.attributes attribute which has the entire raw data. As of now, you could get “also known as” field through entity.attributes['aliases'].

However, it would be better if we have an attribute/property like Entity.aliases.