# wikidata-dl
## Description
**wikidata-dl** is a command line program for downloading data from [Wikidata](https://www.wikidata.org/) based on [SPARQL](https://en.wikipedia.org/wiki/SPARQL) queries.
## Installation
pip install wikidata-dl
## Usage
Download result returned from the query and save it in the directory `./wikidata`:
wikidata-dl /path/to/my-query.sparql
For a complete reference of the command line options run:
wikidata-dl --help
## Sample Query
The following query returns IDs for all Wikidata entities that are an instance of ([P31](https://www.wikidata.org/wiki/Property:P31)) a continent ([Q5107](https://www.wikidata.org/wiki/Q5107)).
SELECT ?item WHERE {
?item wdt:P31 wd:Q5107.
}
[Try the query](https://query.wikidata.org/#SELECT%20%3Fitem%20WHERE%20%7B%20%3Fitem%20wdt%3AP31%20wd%3AQ5107.%20%7D)
Raw data
{
"_id": null,
"home_page": null,
"name": "wikidata-dl",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "cli,command line,dl,download,sparql,wikidata",
"author": null,
"author_email": "Ramiro G\u00f3mez <code@ramiro.org>",
"download_url": "https://files.pythonhosted.org/packages/6c/1e/351d7f8bb4d86cc48ed4e836e812ad1b8937046c632f69b4e512064b6d8e/wikidata_dl-2023.7.27.tar.gz",
"platform": null,
"description": "# wikidata-dl\n\n## Description\n\n**wikidata-dl** is a command line program for downloading data from [Wikidata](https://www.wikidata.org/) based on [SPARQL](https://en.wikipedia.org/wiki/SPARQL) queries.\n\n## Installation\n\n pip install wikidata-dl\n\n## Usage\n\nDownload result returned from the query and save it in the directory `./wikidata`:\n\n wikidata-dl /path/to/my-query.sparql\n\nFor a complete reference of the command line options run:\n\n wikidata-dl --help\n\n## Sample Query\n\nThe following query returns IDs for all Wikidata entities that are an instance of ([P31](https://www.wikidata.org/wiki/Property:P31)) a continent ([Q5107](https://www.wikidata.org/wiki/Q5107)).\n\n SELECT ?item WHERE {\n ?item wdt:P31 wd:Q5107.\n }\n\n[Try the query](https://query.wikidata.org/#SELECT%20%3Fitem%20WHERE%20%7B%20%3Fitem%20wdt%3AP31%20wd%3AQ5107.%20%7D)",
"bugtrack_url": null,
"license": null,
"summary": "Download data from Wikidata based on input SPARQL query.",
"version": "2023.7.27",
"project_urls": {
"Documentation": "https://github.com/yaph/wikidata-dl#readme",
"Issues": "https://github.com/yaph/wikidata-dl/issues",
"Source": "https://github.com/yaph/wikidata-dl"
},
"split_keywords": [
"cli",
"command line",
"dl",
"download",
"sparql",
"wikidata"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "931dbdbf872a500ef641473b956a00ad0f5f6356ac5b2687387ec9c883b2bd30",
"md5": "d48d91ae5a0cf7de82ba5a2eb170fe90",
"sha256": "93ba452dabb2ba59f3a1b5586e5dae6e3e1a1c101efa9c18d92d1be32f2ad737"
},
"downloads": -1,
"filename": "wikidata_dl-2023.7.27-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d48d91ae5a0cf7de82ba5a2eb170fe90",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 7690,
"upload_time": "2023-07-27T20:29:06",
"upload_time_iso_8601": "2023-07-27T20:29:06.111461Z",
"url": "https://files.pythonhosted.org/packages/93/1d/bdbf872a500ef641473b956a00ad0f5f6356ac5b2687387ec9c883b2bd30/wikidata_dl-2023.7.27-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "6c1e351d7f8bb4d86cc48ed4e836e812ad1b8937046c632f69b4e512064b6d8e",
"md5": "685651aaecd965136edb0754bd791cd5",
"sha256": "b8484c5e64696fa49e43ed56dfdf6d188c2b6336ea3a5291f589674d42e41fdc"
},
"downloads": -1,
"filename": "wikidata_dl-2023.7.27.tar.gz",
"has_sig": false,
"md5_digest": "685651aaecd965136edb0754bd791cd5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 8450,
"upload_time": "2023-07-27T20:29:07",
"upload_time_iso_8601": "2023-07-27T20:29:07.767326Z",
"url": "https://files.pythonhosted.org/packages/6c/1e/351d7f8bb4d86cc48ed4e836e812ad1b8937046c632f69b4e512064b6d8e/wikidata_dl-2023.7.27.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-27 20:29:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yaph",
"github_project": "wikidata-dl#readme",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "wikidata-dl"
}