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.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 185e8551db3bf12ce5b3e0dad2990937ed43ee0730a330e5f72ffc9de852d37d |
|
MD5 | 3aba1149722539f3c75e46a187e3411b |
|
BLAKE2b-256 | a6b5d4230c70e696cb1c3c44e0da7ffa29acfd85adb8cf465498de62d7767db6 |
Close
Hashes for acdh_wikidata_pyutils-0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7559e6ec05778e01e046f2f3398b10e8131d8ccdc9fd7f918ebf981fcd568719 |
|
MD5 | 45f6f9e1eec81120ca568ad4eb0392d8 |
|
BLAKE2b-256 | 9c67f3e80fb3a062f89b529c53b61b1241b95ba62352874258e6ebc5bd6ea2c2 |