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
File details
Details for the file acdh-wikidata-pyutils-1.2.tar.gz
.
File metadata
- Download URL: acdh-wikidata-pyutils-1.2.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ba38f34dbb4484775f943f6fe9ae4cbab8220c12cecb323c3eb00cecb4e22eb |
|
MD5 | 61cfa4794a6c85a1c41a6d30130c3a79 |
|
BLAKE2b-256 | 112f00021b629c143a478593bf96b5370549cf9a45359246fdcbb7900cca07d7 |
File details
Details for the file acdh_wikidata_pyutils-1.2-py3-none-any.whl
.
File metadata
- Download URL: acdh_wikidata_pyutils-1.2-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0746f7915971d836ef48b2401ba50675c9d1f0431a9ab6c251fbbd21b0d44ca0 |
|
MD5 | 42bf044853564bd3302aec31679e0fbb |
|
BLAKE2b-256 | 4987a14412fb6210db463d46b6e10a385388b45c697c9bcb204ec9a5769ebfcf |