Skip to main content

Utility package for easily turning a SPARQL query into a dataframe

Project description

wikidata2df Documentation Status

Utility package for easily turning a SPARQL query into a dataframe

Ever wished you could easily and programatically get data from Wikidata into a nice and analysable Pandas DataFrame? Well, this package solves that problem: With a single function you can turn your SPARQL query into a pandas DataFrame, without having to deal with the messy JSON intermediate.

Basic Usage

To install:

$ pip install wikidata2df
from wikidata2df import wikidata2df

# A SPARQL query to return all cats in Wikidata!

cat_query = """
SELECT ?item ?itemLabel
?item wdt:P31 wd:Q146.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }

cats_dataframe = wikidata2df(cat_query) # Returns a Pandas DataFrame


  • Maybe you want more sofisticated functions? Or a way to edit Wikidata programatically? Awesome!

  • Would you rather use R? That’s cool too!


This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.


0.1.0 (2020-08-08)

  • First release on PyPI.

Project details

Download files

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

Files for wikidata2df, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size wikidata2df-0.1.0-py2.py3-none-any.whl (5.8 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size wikidata2df-0.1.0.tar.gz (18.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page