wikidata2df
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.
Free software: BSD license
Documentation: https://wikidata2df.readthedocs.io.
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!
Check out WikidataIntegrator
Would you rather use R? That’s cool too!
Check out WikidataQueryServiceR
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wikidata2df-0.1.0.tar.gz | 18.0 kB | Without provenance | Details for wikidata2df-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wikidata2df-0.1.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for wikidata2df-0.1.0-py2.py3-none-any.whl |
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
|
Security for wikidata2df 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.