openzim / openzim/python-scraperlib

Add a scraper check utility

Open
#124 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement question
Dominant language
Python
Stars
31
Forks
27
Avg merge
3d 7h
Merged PRs (30d)
2

Description

Currently, we rely on various objects in scraperlib to:

  • create the ZIM
  • re-encode videos and images
  • cache these assets on the optimization cache

We might consider to have a mechanism to perform sanity checks on scraper behavior:

  • did we cached all re-encoded images / videos when a cache is present?
  • did we removed temporary files from the filesystem as they are added to the ZIM? (we know that while we prefer in-memory/streaming approaches, there are still many scrapers which are using the temporary file approach, and even some situation which have to rely on it)

What I do not yet know:

  • should we make the scraper fails if these checks fails?
  • is there any chance we automate these checks? (i.e. no need to modify the scrapers, or as little as possible - at least not make a call to "check_i_m_ok" mandatory, because the scraper developers might forget about it as well ; I doubt about this because there are many kind of situations)
  • can we do these checks early? (so that we fail the scraper asap instead of wasting time and resources)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by mapping the scraperlib objects that create ZIMs, re-encode assets, and use the optimization cache, then review how temporary files are handled. Done requires a decided, automated or explicitly invoked sanity-check mechanism and defined failure behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.