Skip to main content

WaybackShot

PyPI

A simple API to retrieve screenshots of webpages stored on the Wayback Machine.

Installation

pip install waybackshot

How to use it

A basic example of how to use WaybackShot is the following:

from waybackshot import WaybackShot
wayback_shot = WaybackShot()

wayback_shot.screenshot("https://www.example.com/")

This will save the most recent archived version of the website https://www.example.com/ in the current folder.

For more flexibility, the following parameters can be passed to the screenshot method:

  • url: URL to request screenshot for.
  • date: (optional) Date to request screenshot for in format YYYYMMDD. If not specified, the most recent screenshot will be returned.
  • filename: (optional) Filename to save screenshot as. If not specified, the URL will be used.
  • dir: (optional) Path to save screenshot to. If not specified, the screenshot will be saved to the current working directory.
  • width: (optional) Width of the screenshot. If not specified, the default width of 1920 will be used.
  • overwrite: (optional) If True, the screenshot will be overwritten if it already exists, otherwise it will not be overwritten.
  • include_date: (optional) If True, the screenshot will be saved with the date of the snapshot, otherwise without it.

A full example might look like this:

from waybackshot import WaybackShot
wayback_shot = WaybackShot()

wayback_shot.screenshot(
        url="https://www.example.com/",
        date="20220520",
        filename="example-filename",
        dir="images",
        width=1920,
        overwrite=True,
        include_date=True,
    )

This will safe the screenshot of https://www.example.com/ from the closest match to the given date in a folder named images with a width of 1920px. If an image with the same name in the same folder already exists, it wil be overwritten. Further, the filename includes the date of the retrieved snapshot as well as uses the specified filename.

Development

If you wish to contribute to this package, be sure to follow the steps provied.

Prerequisites

Before you can start, you have to install all packages used in this package.

pip install -r requirements.txt

This will install the following packages:

  • requests
  • selenium
  • webdriver_manager

Furthermore, Python Version 3.9 is needed.

Metadata

Release files for waybackshot 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for waybackshot 0.2.1
File Size Uploaded Provenance Actions
waybackshot-0.2.1.tar.gz 16.9 kB Without provenance Details for waybackshot-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for waybackshot 0.2.1
File Interpreter ABI Platform Actions
waybackshot-0.2.1-py3-none-any.whl Python 3 none any Details for waybackshot-0.2.1-py3-none-any.whl

Total release size: 35.6 kB

Release files / waybackshot-0.2.1.tar.gz

Download URL waybackshot-0.2.1.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
60941e0d8efc3696630217e146d74b3bd1449a8b7082c8d0124c12ce12978ff7
BLAKE2b-256 checksum
How to use checksums
80d6aa136d187ce4dac2b4d6f1cbc7832ca71126890dc4444ac7bd883644e9a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release files / waybackshot-0.2.1-py3-none-any.whl

Download URL waybackshot-0.2.1-py3-none-any.whl
Size 18.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
714fe27627f4b16db26c1b70d1b8e53e5cc577179d8a7ef9ee6ceb3c98ab75c6
BLAKE2b-256 checksum
How to use checksums
9808e51016903ba0d86cd0c68c2bb33333e38c39ff6b0cd89f8d0cf2aaa22c00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Security for waybackshot 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page