Python package to fetch data from Wikidata
Project description
acdh-wikidata-pyutils
Utitliy 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.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8d10ddbff6a8c6aaede2922cd442f1edd1a1a65e82b031849776528c1556350 |
|
MD5 | 3fa0c7c01dec9c2d542dc79425a260cb |
|
BLAKE2b-256 | d5ca7039b12dec29a01aa104bc05a9cbca57caa55d9449076c36d5196c5bac90 |
Close
Hashes for acdh_wikidata_pyutils-0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7697c1374dee003f5643b8f7dd19a4a01878260dbca50514999b0c72158c912 |
|
MD5 | d5b614cc5b7fbb9900bdaf1832936b27 |
|
BLAKE2b-256 | 11a74a49373a3dabba1d7b259771065115b3f2e1536c834dbbdbc8b2f966b5c1 |