Socket
Book a DemoInstallSign in
Socket

acdh-wikidata-pyutils

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

acdh-wikidata-pyutils

Python package to fetch data from Wikidata

pipPyPI
Version
3.0
Maintainers
2

flake8 Lint Test codecov PyPI version Build the docs

acdh-wikidata-pyutils

Utility package to fetch data from Wikidata

install

pip install acdh-wikidata-pyutils

usage

from acdh_wikidata_pyutils import WikiDataPerson

item = WikiDataPerson("https://www.wikidata.org/wiki/Q44331")
person = item.get_apis_entity()
print(person)
>>> {'name': 'Schnitzler', 'first_name': 'Arthur', 'start_date_written': '1862-05-15', 'end_date_written': '1931-10-21', 'gender': 'male'}
from acdh_wikidata_pyutils import WikiDataPlace

item = WikiDataPlace("https://www.wikidata.org/wiki/Q41329")
place = item.get_apis_entity()
print(place)
>>> {'name': 'Linz', 'lat': 48.30583333333333, 'long': 14.286388888888888}
from acdh_wikidata_pyutils import fetch_image 
wiki_id = "Q2390830"
item = fetch_image(wiki_id)
print(item)
>>> "https://upload.wikimedia.org/wikipedia/commons/thumb/b/ba/Theo._Komisarjevsky_LCCN2014715267.jpg/250px-Theo._Komisarjevsky_LCCN2014715267.jpg"

Keywords

Wikidata

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts