Skip to main content

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 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) a continent (Q5107).

SELECT ?item WHERE {
    ?item wdt:P31 wd:Q5107.
}

Try the query

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wikidata_dl-2023.7.27.tar.gz (8.4 kB view hashes)

Uploaded source

Built Distribution

wikidata_dl-2023.7.27-py3-none-any.whl (7.7 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page