n.roqaya
n.roqaya

Reputation: 19

Functions on Wikipedia dump file

We can use the functions from Wikipedia API to getting some results from Wikipedia.

For example:

**import Wikipedia

print(Wikipedia.search("Bill", results=2)).**

My question, how can I use Wikipedia API functions for a specific version of Wikipedia (e.g. just Wikipedia 2017)?!!

Upvotes: 0

Views: 233

Answers (2)

n.roqaya
n.roqaya

Reputation: 19

On the dump file with specific version, we can not use Wikipedia API. We just can read the dump file by our code and make what we need on this file.

Upvotes: 1

Florian
Florian

Reputation: 2874

I doubt that this is possible. PyWikibot is using the online API of MediaWiki (in this case for the site Wikipedia). This one is always the live data.

The dumps, which you mention, are offline snapshots of the data of Wikipedia (assuming you're talking about https://dumps.wikimedia.org/). This data is not connected to the MediaWiki API in any way and can therefore not being queried with it.

What you can do to go through the data of Wikipedia in a specific time:

  • If it's a limited number of pages only: You could write a script which goes through the available revisions of the page and selects the one, that is closest to the time you want. That's probably error prone, a lot of work and does not really scale
  • Download the dump you want to query on and write a script which can work on the files (e.g. the database dump or the static html dump depending on what you want to do, that's not really clear from your question)

Upvotes: 2

Related Questions