[Analytics] Python client for the new pageview API

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[Analytics] Python client for the new pageview API

Dan Andreescu
Along the same lines as Oliver's great R client [1], I just started work on a python version:


And if you're trying to skip past all the setup repository cruft, the meat: https://github.com/milimetric/wmf/blob/master/wmf/analytics/api/pageviews.py



_______________________________________________
Wiki-research-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wiki-research-l
Reply | Threaded
Open this post in threaded view
|

Re: [Analytics] Python client for the new pageview API

Aaron Halfaker-3
Great work!  I'm glad that someone picked this up in python too.  The rate at which new client libraries have been released for working on the pageviews API is inspiring and hope that the trend continues for new services.

Props to Dan and Ironholds for seeing the need and filling it. :)

On Fri, Dec 11, 2015 at 9:36 PM, Dan Andreescu <[hidden email]> wrote:
Along the same lines as Oliver's great R client [1], I just started work on a python version:


And if you're trying to skip past all the setup repository cruft, the meat: https://github.com/milimetric/wmf/blob/master/wmf/analytics/api/pageviews.py



_______________________________________________
Analytics mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/analytics



_______________________________________________
Wiki-research-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wiki-research-l
Reply | Threaded
Open this post in threaded view
|

Re: [Analytics] Python client for the new pageview API

Toby Negrin
I added these to a section in the API docs:


-Toby

On Sat, Dec 12, 2015 at 7:20 AM, Aaron Halfaker <[hidden email]> wrote:
Great work!  I'm glad that someone picked this up in python too.  The rate at which new client libraries have been released for working on the pageviews API is inspiring and hope that the trend continues for new services.

Props to Dan and Ironholds for seeing the need and filling it. :)

On Fri, Dec 11, 2015 at 9:36 PM, Dan Andreescu <[hidden email]> wrote:
Along the same lines as Oliver's great R client [1], I just started work on a python version:


And if you're trying to skip past all the setup repository cruft, the meat: https://github.com/milimetric/wmf/blob/master/wmf/analytics/api/pageviews.py



_______________________________________________
Analytics mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/analytics



_______________________________________________
Analytics mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/analytics



_______________________________________________
Wiki-research-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wiki-research-l
Reply | Threaded
Open this post in threaded view
|

Re: [Analytics] Python client for the new pageview API

Dan Andreescu
In reply to this post by Dan Andreescu
I wasn't aware of some conventions that came before me, so I moved the project from milimetric/wmf to mediawiki-utilities/python-mwviews.  I promise it'll stay there, sorry for the inconvenience.  Updated links:

code: https://github.com/mediawiki-utilities/python-mwviews (PRs still welcome, thanks for the 2 you already helped with!)

On Fri, Dec 11, 2015 at 10:36 PM, Dan Andreescu <[hidden email]> wrote:
Along the same lines as Oliver's great R client [1], I just started work on a python version:


And if you're trying to skip past all the setup repository cruft, the meat: https://github.com/milimetric/wmf/blob/master/wmf/analytics/api/pageviews.py




_______________________________________________
Wiki-research-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wiki-research-l
Reply | Threaded
Open this post in threaded view
|

Re: [Analytics] Python client for the new pageview API

Aaron Halfaker-3
Awesome!  Welcome to the unix-like MediaWiki python libraries revolution.

Now to set aside some time to contribute and play around :)

On Mon, Dec 14, 2015 at 8:32 AM, Dan Andreescu <[hidden email]> wrote:
I wasn't aware of some conventions that came before me, so I moved the project from milimetric/wmf to mediawiki-utilities/python-mwviews.  I promise it'll stay there, sorry for the inconvenience.  Updated links:

code: https://github.com/mediawiki-utilities/python-mwviews (PRs still welcome, thanks for the 2 you already helped with!)

On Fri, Dec 11, 2015 at 10:36 PM, Dan Andreescu <[hidden email]> wrote:
Along the same lines as Oliver's great R client [1], I just started work on a python version:


And if you're trying to skip past all the setup repository cruft, the meat: https://github.com/milimetric/wmf/blob/master/wmf/analytics/api/pageviews.py




_______________________________________________
Analytics mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/analytics



_______________________________________________
Wiki-research-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wiki-research-l
fn
Reply | Threaded
Open this post in threaded view
|

Re: [Analytics] Python client for the new pageview API

fn
In reply to this post by Dan Andreescu
Is this tool really a MediaWiki utility? As far as I understand the
webservice running from http://wikimedia.org/api/rest_v1/metrics/ is
independent of the MediaWiki software. Or am I misunderstanding
something? The API and the tool are a Wikimedia Foundation project
outside the main MediaWiki development (Github mirror:
https://github.com/wikimedia/analytics-pageview-api), so the previous
name (wmf) was actually better IMHO?

'mwviews' could mislead people to think that it could access view
statistics from any MediaWiki instance. This is not that case if I
understand correctly. "wmviews" would be a better name. :-)

/Finn


On 12/14/2015 03:32 PM, Dan Andreescu wrote:

> I wasn't aware of some conventions that came before me, so I moved the
> project from milimetric/wmf to mediawiki-utilities/python-mwviews.  I
> promise it'll stay there, sorry for the inconvenience.  Updated links:
>
> PyPI: https://pypi.python.org/pypi/mwviews/0.0.2
> code: https://github.com/mediawiki-utilities/python-mwviews (PRs still
> welcome, thanks for the 2 you already helped with!)
>
> On Fri, Dec 11, 2015 at 10:36 PM, Dan Andreescu
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     Along the same lines as Oliver's great R client [1], I just started
>     work on a python version:
>
>     PyPI: https://pypi.python.org/pypi/wmf/0.1
>     code: https://github.com/milimetric/wmf (PRs welcome)
>
>     And if you're trying to skip past all the setup repository cruft,
>     the meat:
>     https://github.com/milimetric/wmf/blob/master/wmf/analytics/api/pageviews.py
>
>
>     [1] https://github.com/Ironholds/pageviews
>
>
>
>
> _______________________________________________
> Wiki-research-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wiki-research-l
>


--
Finn Årup Nielsen
http://people.compute.dtu.dk/faan/

_______________________________________________
Wiki-research-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wiki-research-l
fn
Reply | Threaded
Open this post in threaded view
|

Re: [Analytics] Python client for the new pageview API

fn
Just to confuse the issue further:

You can already get views statistics from the ordinary API of an
ordinary MediaWiki instance (where the $wgDisableCounters is set to false).

For instance, an API call on my wiki could be:
http://neuro.compute.dtu.dk/w/api.php?action=query&prop=info&titles=Amygdala&format=jsonfm 
where the 'counter' field displays the statistics.

On Wikimedia Foundation's MediaWiki instances such as the Wikipedia you
won't get the counter, see
https://da.wikipedia.org/w/api.php?action=query&prop=info&titles=Amygdala&format=jsonfm

/Finn


On 12/15/2015 04:55 PM, Finn Årup Nielsen wrote:

> Is this tool really a MediaWiki utility? As far as I understand the
> webservice running from http://wikimedia.org/api/rest_v1/metrics/ is
> independent of the MediaWiki software. Or am I misunderstanding
> something? The API and the tool are a Wikimedia Foundation project
> outside the main MediaWiki development (Github mirror:
> https://github.com/wikimedia/analytics-pageview-api), so the previous
> name (wmf) was actually better IMHO?
>
> 'mwviews' could mislead people to think that it could access view
> statistics from any MediaWiki instance. This is not that case if I
> understand correctly. "wmviews" would be a better name. :-)
>
> /Finn
>
>
> On 12/14/2015 03:32 PM, Dan Andreescu wrote:
>> I wasn't aware of some conventions that came before me, so I moved the
>> project from milimetric/wmf to mediawiki-utilities/python-mwviews.  I
>> promise it'll stay there, sorry for the inconvenience.  Updated links:
>>
>> PyPI: https://pypi.python.org/pypi/mwviews/0.0.2
>> code: https://github.com/mediawiki-utilities/python-mwviews (PRs still
>> welcome, thanks for the 2 you already helped with!)
>>
>> On Fri, Dec 11, 2015 at 10:36 PM, Dan Andreescu
>> <[hidden email] <mailto:[hidden email]>> wrote:
>>
>>     Along the same lines as Oliver's great R client [1], I just started
>>     work on a python version:
>>
>>     PyPI: https://pypi.python.org/pypi/wmf/0.1
>>     code: https://github.com/milimetric/wmf (PRs welcome)
>>
>>     And if you're trying to skip past all the setup repository cruft,
>>     the meat:
>>
>> https://github.com/milimetric/wmf/blob/master/wmf/analytics/api/pageviews.py
>>
>>
>>
>>     [1] https://github.com/Ironholds/pageviews
>>
>>
>>
>>
>> _______________________________________________
>> Wiki-research-l mailing list
>> [hidden email]
>> https://lists.wikimedia.org/mailman/listinfo/wiki-research-l
>>
>
>


--
Finn Årup Nielsen
http://people.compute.dtu.dk/faan/

_______________________________________________
Wiki-research-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wiki-research-l
Reply | Threaded
Open this post in threaded view
|

Re: [Analytics] Python client for the new pageview API

Aaron Halfaker-3
Good point Finn! 

This is a highly specialized first functionality of mwviews, but it should not stop there.  We should have API methods for gathering the counter field too.  I plan to gather some old code for processing the old hourly view logs to incorporate this into the library too.  So, in short, this isn't really generally useful for MediaWiki, but it should be and will be soon. 

Does anyone have a summary of how views are used/accessed for Wikia wikis that I could work from?

-Aaron

On Tue, Dec 15, 2015 at 10:10 AM, Finn Årup Nielsen <[hidden email]> wrote:
Just to confuse the issue further:

You can already get views statistics from the ordinary API of an ordinary MediaWiki instance (where the $wgDisableCounters is set to false).

For instance, an API call on my wiki could be: http://neuro.compute.dtu.dk/w/api.php?action=query&prop=info&titles=Amygdala&format=jsonfm where the 'counter' field displays the statistics.

On Wikimedia Foundation's MediaWiki instances such as the Wikipedia you won't get the counter, see https://da.wikipedia.org/w/api.php?action=query&prop=info&titles=Amygdala&format=jsonfm

/Finn



On 12/15/2015 04:55 PM, Finn Årup Nielsen wrote:
Is this tool really a MediaWiki utility? As far as I understand the
webservice running from http://wikimedia.org/api/rest_v1/metrics/ is
independent of the MediaWiki software. Or am I misunderstanding
something? The API and the tool are a Wikimedia Foundation project
outside the main MediaWiki development (Github mirror:
https://github.com/wikimedia/analytics-pageview-api), so the previous
name (wmf) was actually better IMHO?

'mwviews' could mislead people to think that it could access view
statistics from any MediaWiki instance. This is not that case if I
understand correctly. "wmviews" would be a better name. :-)

/Finn


On 12/14/2015 03:32 PM, Dan Andreescu wrote:
I wasn't aware of some conventions that came before me, so I moved the
project from milimetric/wmf to mediawiki-utilities/python-mwviews.  I
promise it'll stay there, sorry for the inconvenience.  Updated links:

PyPI: https://pypi.python.org/pypi/mwviews/0.0.2
code: https://github.com/mediawiki-utilities/python-mwviews (PRs still
welcome, thanks for the 2 you already helped with!)

On Fri, Dec 11, 2015 at 10:36 PM, Dan Andreescu
<[hidden email] <mailto:[hidden email]>> wrote:

    Along the same lines as Oliver's great R client [1], I just started
    work on a python version:

    PyPI: https://pypi.python.org/pypi/wmf/0.1
    code: https://github.com/milimetric/wmf (PRs welcome)

    And if you're trying to skip past all the setup repository cruft,
    the meat:

https://github.com/milimetric/wmf/blob/master/wmf/analytics/api/pageviews.py



    [1] https://github.com/Ironholds/pageviews




_______________________________________________
Wiki-research-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wiki-research-l





--
Finn Årup Nielsen
http://people.compute.dtu.dk/faan/

_______________________________________________
Wiki-research-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wiki-research-l


_______________________________________________
Wiki-research-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wiki-research-l
Reply | Threaded
Open this post in threaded view
|

Re: [Analytics] Python client for the new pageview API

Yuvi Panda
In reply to this post by fn
On Tue, Dec 15, 2015 at 8:10 AM, Finn Årup Nielsen <[hidden email]> wrote:
> Just to confuse the issue further:
>
> You can already get views statistics from the ordinary API of an ordinary
> MediaWiki instance (where the $wgDisableCounters is set to false).


https://www.mediawiki.org/wiki/Manual:$wgDisableCounters Wanted to
point out that this feature (counters) was removed from MW recently.

_______________________________________________
Wiki-research-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wiki-research-l