[![Test](https://github.com/acdh-oeaw/acdh-id-reconciler/actions/workflows/test.yml/badge.svg)](https://github.com/acdh-oeaw/acdh-id-reconciler/actions/workflows/test.yml)
[![PyPI version](https://badge.fury.io/py/acdh-id-reconciler.svg)](https://badge.fury.io/py/acdh-id-reconciler)
[![codecov](https://codecov.io/gh/acdh-oeaw/acdh-id-reconciler/branch/main/graph/badge.svg?token=WY0Q1GRIG1)](https://codecov.io/gh/acdh-oeaw/acdh-id-reconciler)
[![flake8 Lint](https://github.com/acdh-oeaw/acdh-id-reconciler/actions/workflows/lint.yml/badge.svg)](https://github.com/acdh-oeaw/acdh-id-reconciler/actions/workflows/lint.yml)
# acdh-id-reconciler
python package to reconcile GND and GeoNames IDs via WikiData.
## install
`pip install acdh-id-reconciler`
## use
### from GND to WikiData and GeoNames ID
```python
from acdh_id_reconciler import gnd_to_geonames
test = "https://d-nb.info/gnd/4010858-2"
results = gnd_to_geonames(test)
print(results)
# {'wikidata': 'http://www.wikidata.org/entity/Q261664', 'gnd': '4010858-2', 'geonames': '2781124'}
```
### from GND to WikiData
```python
from acdh_id_reconciler import gnd_to_wikidata
test = "https://d-nb.info/gnd/4074255-6"
results = gnd_to_wikidata(test)
print(results)
# {'wikidata': 'http://www.wikidata.org/entity/Q41329', 'gnd': '4074255-6'}
```
### from GND to WikiData plus Custom-ID
```python
from acdh_id_reconciler import gnd_to_wikidata_custom
test = "https://d-nb.info/gnd/118634712"
custom = "P6194" # https://www.wikidata.org/wiki/Property:P6194
results = gnd_to_wikidata_custom(test, custom)
print(results)
# {'wikidata': 'http://www.wikidata.org/entity/Q215747', 'gnd': '118634712', 'custom': 'W/Wolf_Hugo_1860_1903'}
```
### from Geonames to WikiData
```python
from acdh_id_reconciler import geonames_to_wikidata
test = "https://www.geonames.org/2761369"
results = geonames_to_wikidata(test)
print(results)
# {'wikidata': 'http://www.wikidata.org/entity/Q1741', 'geonames': '2761369'}
```
### from Geonames to GND
```python
from acdh_id_reconciler import geonames_to_gnd
test = "https://www.geonames.org/2761369"
results = geonames_to_gnd(test)
print(results)
# {'wikidata': 'http://www.wikidata.org/entity/Q1741', 'geonames': '2761369', 'gnd': '4066009-6'}
```
### from Wikidata to Wikipedia
```python
from acdh_id_reconciler import wikidata_to_wikipedia
test = "https://www.wikidata.org/wiki/Q1186567/"
result = wikidata_to_wikipedia(test)
print(result)
# 'https://de.wikipedia.org/wiki/Alexandrinski-Theater'
# default language is set to german, can be changed by settings param result e.g. `wiki_lang='enwiki'`
result = wikidata_to_wikipedia(test, wiki_lang='enwiki')
print(result)
# 'https://en.wikipedia.org/wiki/Alexandrinsky_Theatre'
Raw data
{
"_id": null,
"home_page": "https://github.com/acdh-oeaw/acdh-id-reconciler",
"name": "acdh-id-reconciler",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "",
"author": "Peter Andorfer",
"author_email": "peter.andorfer@oeaw.ac.at",
"download_url": "https://files.pythonhosted.org/packages/b4/b1/1262be5738bcacfbb1659e2f53c9df1ad9f46fe154a163a55646062837c6/acdh_id_reconciler-0.7.1.tar.gz",
"platform": null,
"description": "[![Test](https://github.com/acdh-oeaw/acdh-id-reconciler/actions/workflows/test.yml/badge.svg)](https://github.com/acdh-oeaw/acdh-id-reconciler/actions/workflows/test.yml)\n[![PyPI version](https://badge.fury.io/py/acdh-id-reconciler.svg)](https://badge.fury.io/py/acdh-id-reconciler)\n[![codecov](https://codecov.io/gh/acdh-oeaw/acdh-id-reconciler/branch/main/graph/badge.svg?token=WY0Q1GRIG1)](https://codecov.io/gh/acdh-oeaw/acdh-id-reconciler)\n[![flake8 Lint](https://github.com/acdh-oeaw/acdh-id-reconciler/actions/workflows/lint.yml/badge.svg)](https://github.com/acdh-oeaw/acdh-id-reconciler/actions/workflows/lint.yml)\n\n# acdh-id-reconciler\npython package to reconcile GND and GeoNames IDs via WikiData.\n\n\n## install\n\n`pip install acdh-id-reconciler`\n\n## use\n\n### from GND to WikiData and GeoNames ID\n\n```python\nfrom acdh_id_reconciler import gnd_to_geonames\n\ntest = \"https://d-nb.info/gnd/4010858-2\"\nresults = gnd_to_geonames(test)\nprint(results)\n# {'wikidata': 'http://www.wikidata.org/entity/Q261664', 'gnd': '4010858-2', 'geonames': '2781124'}\n```\n\n### from GND to WikiData\n\n```python\nfrom acdh_id_reconciler import gnd_to_wikidata\n\ntest = \"https://d-nb.info/gnd/4074255-6\"\nresults = gnd_to_wikidata(test)\nprint(results)\n# {'wikidata': 'http://www.wikidata.org/entity/Q41329', 'gnd': '4074255-6'}\n```\n\n### from GND to WikiData plus Custom-ID\n\n ```python\nfrom acdh_id_reconciler import gnd_to_wikidata_custom\n\ntest = \"https://d-nb.info/gnd/118634712\"\ncustom = \"P6194\" # https://www.wikidata.org/wiki/Property:P6194\nresults = gnd_to_wikidata_custom(test, custom)\nprint(results)\n# {'wikidata': 'http://www.wikidata.org/entity/Q215747', 'gnd': '118634712', 'custom': 'W/Wolf_Hugo_1860_1903'}\n```\n\n### from Geonames to WikiData\n\n```python\nfrom acdh_id_reconciler import geonames_to_wikidata\n\ntest = \"https://www.geonames.org/2761369\"\nresults = geonames_to_wikidata(test)\nprint(results)\n# {'wikidata': 'http://www.wikidata.org/entity/Q1741', 'geonames': '2761369'}\n```\n\n### from Geonames to GND\n\n```python\nfrom acdh_id_reconciler import geonames_to_gnd\n\ntest = \"https://www.geonames.org/2761369\"\nresults = geonames_to_gnd(test)\nprint(results)\n# {'wikidata': 'http://www.wikidata.org/entity/Q1741', 'geonames': '2761369', 'gnd': '4066009-6'}\n```\n\n### from Wikidata to Wikipedia\n\n```python\nfrom acdh_id_reconciler import wikidata_to_wikipedia\n\ntest = \"https://www.wikidata.org/wiki/Q1186567/\"\nresult = wikidata_to_wikipedia(test)\nprint(result)\n# 'https://de.wikipedia.org/wiki/Alexandrinski-Theater'\n\n# default language is set to german, can be changed by settings param result e.g. `wiki_lang='enwiki'`\nresult = wikidata_to_wikipedia(test, wiki_lang='enwiki')\nprint(result)\n# 'https://en.wikipedia.org/wiki/Alexandrinsky_Theatre'\n",
"bugtrack_url": null,
"license": "MIT license",
"summary": "Python package to reconcile GND, GeoNames IDs via WikiData",
"version": "0.7.1",
"project_urls": {
"Homepage": "https://github.com/acdh-oeaw/acdh-id-reconciler"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8e025813a8c51ce5d1f565f0137a9081aab8d7d82666dfd6cd5e90a7ff719f52",
"md5": "916c5a04948ffe6a44601d6cd3af063a",
"sha256": "2f98bbeda6c6fc6d2e1d1b515c0b8150336a5bbd9a06c3a6abfd2462edde2b7e"
},
"downloads": -1,
"filename": "acdh_id_reconciler-0.7.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "916c5a04948ffe6a44601d6cd3af063a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 4194,
"upload_time": "2023-12-13T09:22:35",
"upload_time_iso_8601": "2023-12-13T09:22:35.186827Z",
"url": "https://files.pythonhosted.org/packages/8e/02/5813a8c51ce5d1f565f0137a9081aab8d7d82666dfd6cd5e90a7ff719f52/acdh_id_reconciler-0.7.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b4b11262be5738bcacfbb1659e2f53c9df1ad9f46fe154a163a55646062837c6",
"md5": "a668917d20ef765613de58b43f424a4b",
"sha256": "fd75d64d4cfbf442f6e5b1566350020bd3a9d320869134704804a1777002aad7"
},
"downloads": -1,
"filename": "acdh_id_reconciler-0.7.1.tar.gz",
"has_sig": false,
"md5_digest": "a668917d20ef765613de58b43f424a4b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 4640,
"upload_time": "2023-12-13T09:22:36",
"upload_time_iso_8601": "2023-12-13T09:22:36.631990Z",
"url": "https://files.pythonhosted.org/packages/b4/b1/1262be5738bcacfbb1659e2f53c9df1ad9f46fe154a163a55646062837c6/acdh_id_reconciler-0.7.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-13 09:22:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "acdh-oeaw",
"github_project": "acdh-id-reconciler",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "acdh-id-reconciler"
}