Skip to main content

Envelope for archive.org API.

Project description

PyPI version PyPI downloads Stars Contributors Wheel Status PyPi license Last commit

Wayback Machine

This project is an envelope for simple fetching of historical versions of page from archive.org API.

The page can be used for subsequent webscraping

Setup and usage

Install from pip with

pip install waybackmachine

To fetch the latest version from archive, simply use fetch() function.

import waybackmachine as wm

url = "https://en.wikipedia.org/wiki/COVID-19"
latest = wm.fetch(url)
latest.response  # requests.Response
latest.date  # capture time
latest.url  # url

Optionally you can specify date. The first version after this date is chosen.

may2020 = wm.fetch(url, date="2020-05-01")

Browsing

You can also iterate archived versions backwards in time.

for version in wm.browse(url):
    version.response  # requests.Response
    version.date  # capture time
    version.url  # url

This will iterate the screenshots from archive.org.

You can specify a custom date range as follows.

for version in wm.browse(url, start='2020-06-30', end='2020-03-01'):
    pass

Contribution

Developed by Martin Benes.

Join on GitHub.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

waybackmachine-0.5.0.tar.gz (7.7 kB view hashes)

Uploaded Source

Built Distribution

waybackmachine-0.5.0-py3-none-any.whl (6.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page