Skip to main content

py-wacz

The py-wacz repository contains a Python module and command line utility for working with web archive data using the WACZ format specification. Web Archive Collection Zipped (WACZ) allows web archives to be shared and distributed by providing a predictable way of packaging up web archive data and metadata as a ZIP file. The wacz command line utility supports converting any WARC files into WACZ files, and optionally generating full-text search indices of pages.

Install

Use pip to install the module and a command line utility:

pip install wacz

Once installed you can use the wacz command line utility to create and validate WACZ files.

Create

To create a WACZ package you can point wacz at a WARC file and tell it where to write the WACZ with the -o option:

wacz create -o myfile.wacz <path/to/WARC>

The resulting myfile.wacz should be loadable via ReplayWeb.page.

wacz accepts the following options for customizing how the WACZ file is assembled.

-f --file

Explicitly declare the file being passed to the create function.

wacz create -f tests/fixtures/example-collection.warc

-o --output

Explicitly declare the name of the wacz being created.

wacz create tests/fixtures/example-collection.warc -o mywacz.wacz

-t --text

Generates pages.jsonl page index with a full-text index, must be run in conjunction with --detect-pages. Will have no effect if run alone.

wacz create tests/fixtures/example-collection.warc -t

--detect-pages

Generates pages.jsonl page index without a full-text index.

wacz create tests/fixtures/example-collection.warc --detect-pages

-p --pages

Overrides the pages index generation with the passed jsonl pages.

wacz create tests/fixtures/example-collection.warc -p passed_pages.jsonl

-e --extra-pages

Overrides the extra pages index generation with the passed extra jsonl pages.

wacz create tests/fixtures/example-collection.warc -p passed_pages.jsonl -e extra_pages.jsonl

-c --copy-pages

Overrides the behavior of --pages and --extra-pages options to copy existing pages.jsonl and/or extraPages.jsonl as-is directly into the WACZ rather than attempting to match each page to WARC record. The files are still parsed for basic correctness.

wacz create tests/fixtures/example-collection.warc --pages pages/pages.jsonl --extra-pages pages/extraPages.jsonl --copy-pages

-t --text

You can add a full text index by including the --text tag.

wacz create tests/fixtures/example-collection.warc -p passed_pages.jsonl --text

-l --log-directory

Adds log files in specified directory to WACZ

wacz create tests/fixtures/example-collection.warc -l tests/fixtures/logs

--ts

Overrides the ts metadata value in the datapackage.json file.

wacz create tests/fixtures/example-collection.warc --ts TIMESTAMP

--url

Overrides the url metadata value in the datapackage.json file.

wacz create tests/fixtures/example-collection.warc --url URL

--title

Overrides the titles metadata value in the datapackage.json file.

wacz create tests/fixtures/example-collection.warc --title TITLE

--desc

Overrides the desc metadata value in the datapackage.json file.

wacz create tests/fixtures/example-collection.warc --desc DESC

--hash-type

Allows the user to specify the hash type used (sha256 or md5).

wacz create tests/fixtures/example-collection.warc --hash-type md5

--signing-url

An optional URL for WACZ signing server which will be used to add a signature to the new WACZ.

This URL should point to an authsign /sign api endpoint.

See the section on --verify-auth for more info on signing and verification.

--signing-token

An optional, secret token passed to signing server to allow access. See authsign for more details.

Validate

You can also validate an existing WACZ file by running:

wacz validate myfile.wacz

-f --file

Explicitly declare the file being passed to the validate function.

wacz validate -f tests/fixtures/example-collection.warc

--verify-auth

New option in 0.4.0, this option also verifies the WACZ is signed, using authsign

The verification can be done locally, or via remote signing/verification server.

To use remote server, add --verifier-url which should be a URL pointing to the authsign /verify endpoint.

To run locally, the authsign must be installed, which can be done by running pip install wacz[signing].

See WACZ Authentication Spec on WACZ authentication.

This feature and the specification are still in development (alpha-quality) and are subject to change.

Testing

If you are developing wacz you can run the unit tests with pytest:

pytest tests

Metadata

Release files for wacz 0.6.0

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

Source distribution (sdist)

Source distribution for wacz 0.6.0
File Size Uploaded
wacz-0.6.0.tar.gz 23.2 kB Details

Built distribution (wheel)

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

Total release size: 39.8 kB

Release files / wacz-0.6.0.tar.gz

Download URL wacz-0.6.0.tar.gz
Size 23.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4ac2ad58e1c4876c894cd748d8160cad5da06d9fda2440e538af740e3cfc32ff
BLAKE2b-256 checksum
How to use checksums
ffe02393873a77f1f81a805593e6157cf735faff38236e34d75f3d7bb3f5cbe4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / wacz-0.6.0-py3-none-any.whl

Download URL wacz-0.6.0-py3-none-any.whl
Size 16.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cabf4052120119897f773c3bebc34a85937b9cdc68bc9df8714b1e24dc3be8c7
BLAKE2b-256 checksum
How to use checksums
a34a1be0fc7e64d37e6733fe64052ac0edcc600847e887fcff1abf05ca2ec7f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.0

2 release files

0.4.9

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

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