Download data from Wikidata based on input SPARQL query.
Project description
wikidata-dl
Description
wikidata-dl is a command line program for downloading data from Wikidata based on SPARQL queries.
Installation
pip install wikidata_dl
Usage
Download all results returned by the query and store them in the wikidata directory in the current working directory:
wikidata-dl /path/to/my-query.sparql
Show only the result count returned by the query without downloading anything:
wikidata-dl --dry-run /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) a continent (Q5107).
SELECT ?item WHERE {
?item wdt:P31 wd:Q5107.
}
Conventions
- The SPARQL query you pass to the program must return Wikibase IDs.
- The query variable where the entity ID is stored must be called
item.
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wikidata_dl-2019.11.20.tar.gz.
File metadata
- Download URL: wikidata_dl-2019.11.20.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58d1a1b393d5ad6d2d21142b6cf478b61df79d47d9e1d3b4f4ed8b717a84a4c0
|
|
| MD5 |
b902159aee8278a78616ea217af27d90
|
|
| BLAKE2b-256 |
2460f0907302f1930d998448a51ffac0db1b8c772369dbf049472660f2f1b194
|
File details
Details for the file wikidata_dl-2019.11.20-py2.py3-none-any.whl.
File metadata
- Download URL: wikidata_dl-2019.11.20-py2.py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d56a4557191a7caeaa8e81b6d26f9523afb2df457ebc2c378266950824dcdaa
|
|
| MD5 |
6f725178c8483ce3f8f848aecb73737c
|
|
| BLAKE2b-256 |
6d55e3c773d8c288ff4bf549d12b8886f29880e53c093312af2b216bdd819977
|