brawer / wikidata-qrank

Ranking signals for Wikidata
https://qrank.wmcloud.org
MIT License
67 stars 5 forks source link

Python Package #4

Open GiorgioBarnabo opened 3 years ago

GiorgioBarnabo commented 3 years ago

Hi there,

thank you for this cool project! Just a question: would you ever release a Python version of Qrank? It would be very cool to have a simple package that one can install in order to automatically collect all statistics for a bulk of wikidata entities :)

Thank you again.

Best,

Giorgio

brawer commented 3 years ago

For a Python example, have a look at the data pipeline for this map of castles in Switzerland; it uses QRank for choosing which castles get displayed at what zoom level. Specifically, check out fetch_wikidata_qrank() and read_wikidata_qrank(). Were you looking for something like this?

GiorgioBarnabo commented 3 years ago

Dear Brawer,

first of all, thank you very much for your quick answer. I looked into the source code of the project that displays the Swiss castles according to their popularity on Wikipedia. It is interesting and close to what I meant, nonetheless it is not exactly what I would need. I think it would be cool to extend the pageview wikipedia APIs in order to fetch data using the wikidata IDs regardeless of the language. This is more or less what already happens with this functionality, but no APIs are available for performing such request. Moreover, on that interface, the user needs to specify the language and the string associated to the page he or she is interested in. What about a simple python module that automatically retrieves all the wikipedia statistics for a specific wikidata entity? For example, given the entity Q1234, a date range, and a granularity, I want to know the statistics for all the related wikipedia pages.

I think that your tool could be easily extended to do that, right? I could help with the implementation :)

Best and thanks again,

Giorgio