Registry / data / warc3-wet-clueweb09

warc3-wet-clueweb09

JSON →
library0.2.5pypypi✓ verified 82d ago

A Python library designed to efficiently parse and work with ARC and WARC files, specifically tailored with fixes and optimizations for ClueWeb09 WET (Web Extracted Text) files. It provides an interface to iterate over records within these compressed archives. The current version is 0.2.5, indicating a pre-1.0 status with potential for future API changes, and it's maintained on an as-needed basis.

pip install warc3-wet-clueweb09
INSTALL
IMPORT
SIG · WARC3-WET-CLUEWEB0
W
warc3-wet-clueweb09
datapythonv0.2.5
Install
2.4s avg
Import
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.3MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 2.4s · import 0.000s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

WARCFile
from warc3_wet_clueweb09 import WARCFile
from warc3_wet_clueweb09 import Warc3Record
WARCRecord
from warc3_wet_clueweb09 import WARCRecord
ARCFile
from warc3_wet_clueweb09 import ARCFile

This quickstart demonstrates how to create a dummy ClueWeb09 WET.gz file and then use `warc3-wet-clueweb09` to parse records from it. It shows the basic steps of opening the gzipped file in binary mode and iterating through the `Warc3Record` objects.

import gzip import os from warc3_wet_clueweb09 import Warc3Record # Create a dummy WET.gz file for demonstration purposes dummy_wet_content = b"WARC/1.0\r\nWARC-Type: wet\r\nWARC-Record-ID: <urn:uuid:1>\r\nContent-Type: text/plain\r\nContent-Length: 21\r\n\r\nHello ClueWeb09 World!\r\nWARC/1.0\r\nWARC-Type: wet\r\nWARC-Record-ID: <urn:uuid:2>\r\nContent-Type: text/plain\r\nContent-Length: 17\r\n\r\nAnother line here\r\n" dummy_filepath = "dummy.wet.gz" with gzip.open(dummy_filepath, "wb") as f: f.write(dummy_wet_content) # Now, parse records from the dummy file try: with gzip.open(dummy_filepath, 'rb') as f: print(f"Reading records from: {dummy_filepath}") for i, record in enumerate(Warc3Record.parse_records(f)): print(f"--- Record {i+1} ---") print(f"WARC-Type: {record.warc_type}") print(f"WARC-Record-ID: {record.warc_record_id}") if record.content: print(f"Content (first 50 chars): {record.content.decode('utf-8', errors='ignore').strip()[:50]}...") except Exception as e: print(f"An error occurred: {e}") finally: # Clean up the dummy file if os.path.exists(dummy_filepath): os.remove(dummy_filepath) print(f"Cleaned up: {dummy_filepath}")
Debug
Known issues
gotchaThis library is specifically designed with 'fixes for ClueWeb09 WET files'. While it may work for general WARC/WET files, its behavior and parsing accuracy are optimized for the ClueWeb09 dataset. Using it for other WARC archives might lead to unexpected parsing errors or incomplete data extraction.
fix
Always verify parsed data when using with non-ClueWeb09 WARC/WET files. Consider more general WARC libraries like `warcio` or `warc` for broader compatibility.
affects: <1.0
gotchaThe library is in a pre-1.0 version (0.2.5). This implies that the API might not be stable, and breaking changes could be introduced in minor updates. Always review the release notes when upgrading.
fix
Pin the library version in your `requirements.txt` (e.g., `warc3-wet-clueweb09==0.2.5`) to ensure consistent behavior across deployments. Test thoroughly after any version upgrade.
affects: <1.0
gotchaWhen opening `.wet.gz` files, it is crucial to use `gzip.open` and specify binary read mode (`'rb'`). Incorrect file handling (e.g., opening with `open()` or in text mode) will result in `OSError: Not a gzipped file` or `struct.error`.
fix
Always open gzipped WARC/WET files using `gzip.open(filepath, 'rb')`. Ensure the file exists and is indeed gzipped.
affects: All
Upgrade
Version history
0.2.5latest on PyPI · released Dec 7, 2020
Audit
Dependencies

No dependency data recorded yet.

Agent activity
32 hits · last 30 days
node
28
OpenAI (training)
1
Resources
warc3-wet-clueweb09 — pip install warc3-wet-clueweb09 · libregistry