A simple package designed to collect the edit histories of Wikipedia pages
Project description
Wikipedia Histories
A simple tool to allow a user to pull the edit history of a Wikipedia page in a variety of formats, including JSON, DataFrame, or directly as an object.
>>> import wikipedia_histories
# Generate a list of revisions for a specified page
>>> golden_swallow = get_history('Golden swallow')
# Show the revision IDs for every edit
>>> golden_swallow
# [130805848, 162259515, 167233740, 195388442, 201696349, 221118422, 261207376, 269921878, 301716350, 304532738, 313393438, 331102653, 331445658, 479287772, 491418997, 496330470, 512226517, 515748101, 529222476, 544800300, 595340940, 609293063, 609296694, 613594135, 663245484, 709269059, 709269330, 709269730, ...
# Show the user who made a specific edit
>>> golden_swallow[16].user
# u'Snowmanradio'
# Show the text of a specific edit
>>> golden_swallow[16].text
# u'The Golden Swallow (Tachycineta euchrysea) is a swallow. The Golden Swallow formerly bred on the island of Jamaica,'...
>>> golden_swallow[200].text
# u'The golden swallow (Tachycineta euchrysea) is a passerine in the swallow family, Hirundinidae. Two subspecies are recognised,'...
# Generate a dataframe from a list of revision history
>>> build_df(golden_swallow)
# Generate a JSON representation of the revision history
>>> build_json(golden_swallow)
Installation
To install Wikipedia Histories, simply run:
$ pip install wikipedia-histories
Wikipedia Histories is compatible with Python 3.6+.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for wikipedia_histories-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82397298a962cd0e976a7ade48410d14490fa636136a77447fbe1c8b08ec06f9 |
|
MD5 | 4bb6c36a6274002acdb51b51d6f17b54 |
|
BLAKE2b-256 | 545d4bfd711d24f103f8a1ae480afc6c9f0b70dbf331c4187ff2728efdd45fd2 |
Close
Hashes for wikipedia_histories-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a15d0ad6ff560837bb97ff6b98680e5a10ee44c705dad2ab89bed87964d596ea |
|
MD5 | 2b7d88efe9f5850c3d7f2ea26455f757 |
|
BLAKE2b-256 | 680c244d4cffedf4b01e04fac4d7b422a94a4af4e9de0d052b8c923586f0a568 |