Skip to main content

wikidata2df

https://img.shields.io/pypi/v/wikidata2df.svg https://img.shields.io/travis/jvfe/wikidata2df.svg 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 = """
#Cats
SELECT ?item ?itemLabel
WHERE
{
?item wdt:P31 wd:Q146.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
"""

cats_dataframe = wikidata2df(cat_query) # Returns a Pandas DataFrame

Alternatives

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

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

Credits

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

History

0.1.0 (2020-08-08)

  • First release on PyPI.

Metadata

Release files for wikidata2df 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wikidata2df 0.1.0
File Size Uploaded
wikidata2df-0.1.0.tar.gz 18.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wikidata2df 0.1.0
File Interpreter ABI Platform
wikidata2df-0.1.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 23.8 kB

Release files / wikidata2df-0.1.0.tar.gz

Download URL wikidata2df-0.1.0.tar.gz
Size 18.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1a9440162388bfcdac49ac7f9013df5bc6088b635af958ef277fe56a65295ae6
BLAKE2b-256 checksum
How to use checksums
664f8a35f641c0d5263d06ba3bffadcb501cc1d8b5956663c0f58e6835a9879a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.14.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Release files / wikidata2df-0.1.0-py2.py3-none-any.whl

Download URL wikidata2df-0.1.0-py2.py3-none-any.whl
Size 5.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
39bb127e2909f642bda2e1f037b990aed6cc069d6bd62cfdffeec1e1bc3f769d
BLAKE2b-256 checksum
How to use checksums
d93103cffaee1bca02c503bcee5f94dbd3453f4951d7f2bd52088da2b75a4517
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.14.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page