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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file waybackmachine-0.5.0.tar.gz.

File metadata

  • Download URL: waybackmachine-0.5.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for waybackmachine-0.5.0.tar.gz
Algorithm Hash digest
SHA256 c3400901bd51c3a6e542502861e8e1cb21f412063daf8325b92a0269059e7cc7
MD5 1b47ebe2223b48cdfad6f3d810f723fb
BLAKE2b-256 b20352950ac71a6efaf59266732f98bbde30b3ed556933810dbe580a44ef6398

See more details on using hashes here.

File details

Details for the file waybackmachine-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: waybackmachine-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for waybackmachine-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c74cad5dc0e465eba86f826e356ed6a44982f84bcd11caaa1846a6ce0ebcdab
MD5 623540471ccbce1d591f7d16ab43a5d1
BLAKE2b-256 49c04b76c8856b8710aca29a4c375f5220414e089f0e44b135624cb6b9149333

See more details on using hashes here.

Supported by

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