Python package to fetch data from Wikidata
Project description
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file acdh_wikidata_pyutils-3.0.tar.gz.
File metadata
- Download URL: acdh_wikidata_pyutils-3.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb9f0e21cd7bfbc58f511e7eec39f9ed1d33d7193731dc4746ac7b359eef3432
|
|
| MD5 |
c2fc08c5347562e9bf3a6ec6b1505442
|
|
| BLAKE2b-256 |
3eae51a3a8a480a867abea21357e126cd9ab165a946ddbfaaaa27261607e32ca
|
File details
Details for the file acdh_wikidata_pyutils-3.0-py3-none-any.whl.
File metadata
- Download URL: acdh_wikidata_pyutils-3.0-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43e6da6015e7b6efeb6f0f1a5a0fe0a3baa2f4e3fd642a9452c71c7219ac883d
|
|
| MD5 |
5e5d6440fc152bd2ff91b4fd5f5da4c7
|
|
| BLAKE2b-256 |
641e5da60971441e4205ef791a3d825a7bfd9f2465a8a298ad721daa9b84cf03
|