Skip to main content

Python package to fetch data from Wikidata

Project description

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"

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

acdh_wikidata_pyutils-3.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file acdh_wikidata_pyutils-3.1.tar.gz.

File metadata

  • Download URL: acdh_wikidata_pyutils-3.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for acdh_wikidata_pyutils-3.1.tar.gz
Algorithm Hash digest
SHA256 156c6adeca663d132dc46f80f844acee84e646f6a53a83560cdddd9cee202a8d
MD5 64cda5114cee7730e38467ec304abe52
BLAKE2b-256 1ed37b33b8da15ad455620b016664eaee0a5bdfbc068d9bebe44c202d6f6be8d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: acdh_wikidata_pyutils-3.1-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for acdh_wikidata_pyutils-3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 66bd1b4e55c0b1f219e37e1d6fc357418c73c3688b6991b629004a26706e6749
MD5 5aaf43f54c83175252513ae0e5108485
BLAKE2b-256 4309221c4908161e1142138b099db4d8da92a17e4ffff1f067eb7f957cf28a8e

See more details on using hashes here.

Supported by

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