Fetchez Hooks#

Hooks allow you to intercept, filter, and modify data before, during or after the fetch process.

fetchez.hooks.__init__#

This init file also holds the FetchHook super class

copyright:
  1. 2010-2026 Regents of the University of Colorado

license:

MIT, see LICENSE for more details.

class fetchez.hooks.FetchHook(stage=None, **kwargs)[source]#

Bases: object

Base class for all Fetchez Hooks.

name = 'base_hook'#
meta_desc = 'Does something.'#
meta_category = 'uncategorized'#
meta_stage = 'file'#
__init__(stage=None, **kwargs)[source]#
teardown()[source]#

Cleanup.

Called strictly once after all processing is complete. Override this to close files, finalize grids, or print summaries.

run(entry)[source]#

Execute the hook.

Parameters:

entry – For ‘file’ stage: [url, path, type, status] For ‘manifest’/’collection’: The full list of results (so far) or context.

Returns:

Modified entry (for ‘file’ stage pipeline) or None.