Python package to fetch data from Wikidata
Project description
acdh-wikidata-pyutils
Utility package to fetch data from Wikidata
development
- create virtual env
python -m venv venv
and activate itsource 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
Built Distribution
Close
Hashes for acdh-wikidata-pyutils-1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c146fc2d98768f16ad760e9dc81580c80f0c2a99dbdfe1c5be9ba8e4fb5fcdb |
|
MD5 | 4c6fc81a55f747edae645a6df7e48264 |
|
BLAKE2b-256 | 6df692be71131162b68e39ee6c925a0ce2c79c3448f6638a52c55611dbb308e3 |
Close
Hashes for acdh_wikidata_pyutils-1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d008d8fd7fbc53041fa32471baa4e5b25192726a883947374e364caea6999a5 |
|
MD5 | b9032f99f2d1b18ba37c4beb16c21f5a |
|
BLAKE2b-256 | 559c5a3abd67d30499f1453804635935976427796f58a791b07c1f1fab0eb1bd |