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.3.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56b93c7e110f538e1680ec14fc978c4da1facc4f121f2deaf9459c96efc3bcbe |
|
MD5 | 351be9090c0b6dc6bfec19dfdf1299d1 |
|
BLAKE2b-256 | 426a7d52a149cda0f7946573b1c4e047b6237640ac381dbd7778772707d9749e |
Close
Hashes for acdh_wikidata_pyutils-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 218069d6fac15c412306691b3b6ff0a04298a00cb72f00bdaafe451b06089ec7 |
|
MD5 | dc613defa3cb3860d06da5b99aced924 |
|
BLAKE2b-256 | 3be2cd12b0f5721a70746f6c9c009ca63a050a2235c003ea273bc6ec87844301 |