Metadata-Version: 2.0
Name: sparqldataframe
Version: 0.1.0
Summary: Get a Pandas dataframe from SPARQL queries
Home-page: https://github.com/njanakiev/sparqldataframe
Author: Nikolai Janakiev
Author-email: nikolai.janakiev@gmail.com
License: MIT
Platform: any
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX
Classifier: Operating System :: MacOS
Classifier: Operating System :: Unix
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: pandas
Requires-Dist: requests

sparqldataframe
===============

.. image:: https://img.shields.io/pypi/v/sparqldataframe.svg
        :target: https://pypi.python.org/pypi/sparqldataframe


A Python library that can send `SPARQL`_ queries to a SPARQL endpoint and retrieve a `Pandas`_ dataframe from the result.


Installation
------------

.. code-block:: bash

	pip install sparqldataframe


Usage
-----

Here is an example how to run a SPARQL query on the `Wikidata`_ endpoint:

.. code-block:: python

	import sparqldataframe

	sparql_query = """
	SELECT ?item ?itemLabel 
	WHERE {
	  ?item wdt:P31 wd:Q146.
	  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
	}
	"""
	df = sparqldataframe.query("https://query.wikidata.org/sparql", sparql_query)

Wikidata and `DBPedia`_ can be both used without adding the SPARQL endpoint url by using the :code:`wikidata_query()` and :code:`dbpedia_query()` functions respectively:

.. code-block:: python

	df = sparqldataframe.wikidata_query(sparql_query)
	df = sparqldataframe.dbpedia_query(sparql_query)


License 
-------

This project is licensed under the MIT license. See the `LICENSE`_ for details.


.. _SPARQL: https://en.wikipedia.org/wiki/SPARQL
.. _Wikidata: http://wikidata.org/
.. _DBPedia: http://dbpedia.org/
.. _Pandas: http://pandas.pydata.org/
.. _LICENSE: LICENSE


