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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c20381ea76cae806bb77b7de3838dfe0dd6bddd3bcc3a699393b39c30cf767e |
|
MD5 | d01add8e15779f641afc5629c2543819 |
|
BLAKE2b-256 | 6fe54f9436621bf464c0dcf48a8842fd994b1704a7b2d77dc1a3c9f336fa2d7a |
Close
Hashes for acdh_wikidata_pyutils-1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1904674ed7f71c14ff797b98c8955f102bb70414a5d5478b4ec8f1850524bd41 |
|
MD5 | 764ade8a453535597ad8e2636ddb0bcf |
|
BLAKE2b-256 | bb61f4e8f162004f47352096bde37c5fe37c2f914e12689214b7d699f497cd4a |