Skip to content

daviddavo/wdsparql

Repository files navigation

PyPI - License PyPI PyPI - Status Binder

wdsparqlmagic

IPython magic to run Wikidata's Sparql queries on the notebooks

Sample Notebook

You can run the sample notebook on binder

Features

Magics

  • %%wdsparql: Runs the cell as a sparql query on your notebook
  • %wdseturl <url>: Sets the url to run the queries against
  • %wdreseturl: Resets the url

Other features

  • After running a wdsparql query, a pandas dataframe will be available as _dfwd. You can run all common pandas operations against it.

Developing

Publishing

Just add a new tag or release with git tag vX.Y.Z -m "<Comment>"; git push --tags

TODO:

  • What happens if an error occurs?
    • Raising custom exception
  • Expose the last query result to the namespace as a pandas dataframe
  • Create setup.py
  • Upload to pypi
  • Make sample notebook (use wikipedia's queries)
  • Write the README.md
    • Button to "run with binder"
    • Explain all the magics:
      • wdsparql
      • wdseturl
      • wdreseturl
  • Testing
    • Unit testing for the functions
    • Visual testing for the sample notebook
  • Make test, build and upload automatically using github actions
    • Check linting tools
    • Use matrix to check with multiple python versions
  • For displaying, stop using dataframes and use a custom class
    • Make links clickable
    • Make items appear as <a href="<link">Q1984194810</a>
    • Display images
    • Display map
  • Adding more queries than the simple ones to the notebook

Optional:

  • Making a new kernel instead of an extension (select cell language: sparql)

About

IPython magic to run Wikidata's Sparql queries on the notebooks

Resources

License

Stars

Watchers

Forks

Packages

No packages published