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-0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7412cffabc15b3383d6d3feb3d41213fd1540152487e3422eccd87db9716cd84 |
|
MD5 | 102d950945e90da876503cfd3f919b40 |
|
BLAKE2b-256 | 54eab63d95ecaea0896bd37fd8416c7ee4c4b591415adb234b3d6dd75808b7cc |
Close
Hashes for acdh_wikidata_pyutils-0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc8bd9b14e43156c495119987623c9d1bf32a1b3f4052492c0011badea46691b |
|
MD5 | c3d25042746a84d36c6f55eb3238b015 |
|
BLAKE2b-256 | fbc9f3a14923a371a949e219f67ee957e8d1f1640631d665ed895018f20e704a |