Skip to main content

WARC file format library

Project description

PyWarc

Python library for WebArchive's WARC file format manipulation.

How to read a warc file:

warc = WarcReader(open("my_archive.warc"))
blk = warc.get_next_block() # read a block

print(blk.content_length) # get content length
print(blk.headers)        # read headers
print(blk.read(10))       # read x bytes
print(blk.read())         # read everything

blk = warc.get_next_block() # read next block
# note that you won't be able to read the previous block anymore
# if the file is not seekable.

print(blk.content_length) # get content length
print(blk.headers)        # read headers

# you can also get the content as a stream
stream = blk.get_as_stream()
print(stream.readline()) # for easier manipulation

# or you can even use a for loop to iterate on each blocks
for blk in warc:
    print(blk.headers["WARC-Record-ID"])

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

pywarc-0.1.0-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

Details for the file pywarc-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pywarc-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for pywarc-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79a753af0b978a0bdb78d1f108d506cd074fd09ebdf6a45c5e5fddd8e7b293f4
MD5 5926726efb0b70d6ac1c0889ccbec3f6
BLAKE2b-256 bdbbc5467ee500e0db102f2b626e00368a7b48735897052b5c49ce2ccac5b2b2

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