[![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}
```
Raw data
{
"_id": null,
"home_page": "https://github.com/acdh-oeaw/acdh-wikidata-pyutils",
"name": "acdh-wikidata-pyutils",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": null,
"author": "Peter Andorfer",
"author_email": "peter.andorfer@oeaw.ac.at",
"download_url": "https://files.pythonhosted.org/packages/11/2f/00021b629c143a478593bf96b5370549cf9a45359246fdcbb7900cca07d7/acdh-wikidata-pyutils-1.2.tar.gz",
"platform": null,
"description": "[![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)\n[![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)\n[![codecov](https://codecov.io/gh/acdh-oeaw/acdh-wikidata-pyutils/graph/badge.svg?token=5ZWMXlmFmr)](https://codecov.io/gh/acdh-oeaw/acdh-wikidata-pyutils)\n[![PyPI version](https://badge.fury.io/py/acdh-wikidata-pyutils.svg)](https://badge.fury.io/py/acdh-wikidata-pyutils)\n\n# acdh-wikidata-pyutils\nUtility package to fetch data from Wikidata\n\n## development\n\n* create virtual env `python -m venv venv` and activate it `source venv/bin/activate`\n* install dev-dependencies `pip install -r requirements_dev.txt`\n* install acdh-wikidata-pyutils locally `pip install -e .`\n* run tests `coverage run -m pytest`\n\n# usage\n\n```python\nfrom acdh_wikidata_pyutils import WikiDataPerson\n\nitem = WikiDataPerson(\"https://www.wikidata.org/wiki/Q44331\")\nperson = item.get_apis_entity()\nprint(person)\n# {'name': 'Schnitzler', 'first_name': 'Arthur', 'start_date_written': '1862-05-15', 'end_date_written': '1931-10-21', 'gender': 'male'}\n```\n\n```python\nfrom acdh_wikidata_pyutils import WikiDataPlace\n\nitem = WikiDataPlace(\"https://www.wikidata.org/wiki/Q41329\")\nplace = item.get_apis_entity()\nprint(place)\n# {'name': 'Linz', 'lat': 48.30583333333333, 'long': 14.286388888888888}\n```\n",
"bugtrack_url": null,
"license": "MIT license",
"summary": "Python package to fetch data from Wikidata",
"version": "1.2",
"project_urls": {
"Homepage": "https://github.com/acdh-oeaw/acdh-wikidata-pyutils"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4987a14412fb6210db463d46b6e10a385388b45c697c9bcb204ec9a5769ebfcf",
"md5": "42bf044853564bd3302aec31679e0fbb",
"sha256": "0746f7915971d836ef48b2401ba50675c9d1f0431a9ab6c251fbbd21b0d44ca0"
},
"downloads": -1,
"filename": "acdh_wikidata_pyutils-1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "42bf044853564bd3302aec31679e0fbb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 4566,
"upload_time": "2024-10-09T07:19:31",
"upload_time_iso_8601": "2024-10-09T07:19:31.657342Z",
"url": "https://files.pythonhosted.org/packages/49/87/a14412fb6210db463d46b6e10a385388b45c697c9bcb204ec9a5769ebfcf/acdh_wikidata_pyutils-1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "112f00021b629c143a478593bf96b5370549cf9a45359246fdcbb7900cca07d7",
"md5": "61cfa4794a6c85a1c41a6d30130c3a79",
"sha256": "0ba38f34dbb4484775f943f6fe9ae4cbab8220c12cecb323c3eb00cecb4e22eb"
},
"downloads": -1,
"filename": "acdh-wikidata-pyutils-1.2.tar.gz",
"has_sig": false,
"md5_digest": "61cfa4794a6c85a1c41a6d30130c3a79",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 4398,
"upload_time": "2024-10-09T07:19:33",
"upload_time_iso_8601": "2024-10-09T07:19:33.119408Z",
"url": "https://files.pythonhosted.org/packages/11/2f/00021b629c143a478593bf96b5370549cf9a45359246fdcbb7900cca07d7/acdh-wikidata-pyutils-1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-09 07:19:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "acdh-oeaw",
"github_project": "acdh-wikidata-pyutils",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "acdh-wikidata-pyutils"
}