Skip to main content

zimscraperlib

QA Status Tests Status CodeFactor License: GPL v3 PyPI version shields.io PyPI - Python Version codecov Read the Docs

Collection of python code to re-use across python-based scrapers

Usage

  • This library is meant to be installed via PyPI (zimscraperlib).
  • Make sure to reference it using a version code as the API is subject to frequent changes.
  • API should remain the same only within the same minor version.

Example usage:

zimscraperlib>=1.1,<1.2

See documentation at Read the Docs for details.

Dependencies

Most dependencies are installed automatically by pip (from PyPI by default). The following system packages may be required depending on which features you use:

  • libmagic — required for file type detection (used in most scrapers)
  • wget — required only for zimscraperlib.download functions
  • FFmpeg — required only for video processing functions
  • gifsicle (>=1.92) — required only for GIF optimization
  • libcairo — required only for SVG-to-PNG conversion
  • libzim — auto-installed via PyPI, not available on Windows
  • Pillow — auto-installed via PyPI; pre-built wheels are used by default and no system image libraries are needed. Only if you need to build Pillow from source should you install additional system libraries — see Pillow's build documentation for details.

    Note: To run the full test suite, all system dependencies listed above must be installed.

macOS

brew install libmagic wget ffmpeg gifsicle cairo

Linux

sudo apt install libmagic1 wget ffmpeg gifsicle libcairo2

Alpine

apk add ffmpeg gifsicle libmagic wget cairo

Contribution

This project adheres to openZIM's Contribution Guidelines.

This project has implemented openZIM's Python bootstrap, conventions and policies v2.0.0.

All instructions below must be run from the root of your local clone of this repository.

If you do not already have it on your system, install hatch:

pip install hatch

Start a hatch shell — this will install all dependencies including dev in an isolated virtual environment:

hatch shell

Set up the pre-commit Git hook (runs linters automatically before each commit):

pre-commit install

Run tests with coverage:

invoke coverage

Users

Non-exhaustive list of scrapers using it (check status when updating API):

Metadata

Release files for zimscraperlib 5.5.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 zimscraperlib 5.5.0
File Size Uploaded Provenance Actions
zimscraperlib-5.5.0.tar.gz 6.7 MB With provenance Details for zimscraperlib-5.5.0.tar.gz

Built distribution (wheel)

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

Total release size: 6.8 MB

Release files / zimscraperlib-5.5.0.tar.gz

Download URL zimscraperlib-5.5.0.tar.gz
Size 6.7 MB
Tags Source
SHA-256 checksum
How to use checksums
79ba853c7acb9e4fba3c564adbb4c12658b90aeb4361478e01c19cf807ea1760
BLAKE2b-256 checksum
How to use checksums
c283ad8ac8a4b537fcedc138aa2d5f2e59b431387f564f8f3392a8db12fdf31f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / zimscraperlib-5.5.0-py3-none-any.whl

Download URL zimscraperlib-5.5.0-py3-none-any.whl
Size 139.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3cc05ebc0e2902ac9a0ae1d24bde46f50e2e8a7cf4e25b2ad200841de6f826e
BLAKE2b-256 checksum
How to use checksums
4804fa2892f6eb106316efd471a1a3ad8eaed5f9ef7855a880f3e2186ae4403f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Security for zimscraperlib 5.5.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for zimscraperlib-5.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

5.5.0 This release

2 release files Full provenance

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