Skip to main content

Python package to fetch data from Wikidata

Project description

flake8 Lint Test codecov PyPI version

acdh-wikidata-pyutils

Utility package to fetch data from Wikidata

development

  • create virtual env python -m venv venv and activate it source venv/bin/activate
  • install dev-dependencies pip install -r requirements_dev.txt
  • install acdh-wikidata-pyutils locally pip install -e .
  • run tests coverage run -m pytest

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}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

acdh-wikidata-pyutils-1.2.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

acdh_wikidata_pyutils-1.2-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file acdh-wikidata-pyutils-1.2.tar.gz.

File metadata

  • Download URL: acdh-wikidata-pyutils-1.2.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for acdh-wikidata-pyutils-1.2.tar.gz
Algorithm Hash digest
SHA256 0ba38f34dbb4484775f943f6fe9ae4cbab8220c12cecb323c3eb00cecb4e22eb
MD5 61cfa4794a6c85a1c41a6d30130c3a79
BLAKE2b-256 112f00021b629c143a478593bf96b5370549cf9a45359246fdcbb7900cca07d7

See more details on using hashes here.

File details

Details for the file acdh_wikidata_pyutils-1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for acdh_wikidata_pyutils-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0746f7915971d836ef48b2401ba50675c9d1f0431a9ab6c251fbbd21b0d44ca0
MD5 42bf044853564bd3302aec31679e0fbb
BLAKE2b-256 4987a14412fb6210db463d46b6e10a385388b45c697c9bcb204ec9a5769ebfcf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page