Metadata-Version: 2.1
Name: acdh-wikidata-pyutils
Version: 1.2
Summary: Python package to fetch data from Wikidata
Home-page: https://github.com/acdh-oeaw/acdh-wikidata-pyutils
Author: Peter Andorfer
Author-email: peter.andorfer@oeaw.ac.at
License: MIT license
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: acdh-arche-assets<4,>=3.6
Requires-Dist: typing-extensions<5,>=4.12.2
Requires-Dist: Wikidata<1,>=0.7.0
Requires-Dist: requests

[![flake8 Lint](https://github.com/acdh-oeaw/acdh-wikidata-pyutils/actions/workflows/lint.yml/badge.svg)](https://github.com/acdh-oeaw/acdh-wikidata-pyutils/actions/workflows/lint.yml)
[![Test](https://github.com/acdh-oeaw/acdh-wikidata-pyutils/actions/workflows/test.yml/badge.svg)](https://github.com/acdh-oeaw/acdh-wikidata-pyutils/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/acdh-oeaw/acdh-wikidata-pyutils/graph/badge.svg?token=5ZWMXlmFmr)](https://codecov.io/gh/acdh-oeaw/acdh-wikidata-pyutils)
[![PyPI version](https://badge.fury.io/py/acdh-wikidata-pyutils.svg)](https://badge.fury.io/py/acdh-wikidata-pyutils)

# acdh-wikidata-pyutils
Utility package to fetch data from Wikidata

## development

* create virtual env `python -m venv venv` and activate it `source 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

```python
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'}
```

```python
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}
```
