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-0.4.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

acdh_wikidata_pyutils-0.4-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: acdh-wikidata-pyutils-0.4.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for acdh-wikidata-pyutils-0.4.tar.gz
Algorithm Hash digest
SHA256 7412cffabc15b3383d6d3feb3d41213fd1540152487e3422eccd87db9716cd84
MD5 102d950945e90da876503cfd3f919b40
BLAKE2b-256 54eab63d95ecaea0896bd37fd8416c7ee4c4b591415adb234b3d6dd75808b7cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for acdh_wikidata_pyutils-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bc8bd9b14e43156c495119987623c9d1bf32a1b3f4052492c0011badea46691b
MD5 c3d25042746a84d36c6f55eb3238b015
BLAKE2b-256 fbc9f3a14923a371a949e219f67ee957e8d1f1640631d665ed895018f20e704a

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