zabgrab.services.metadata¶
Metadata saved with fetched data: enough to understand and repeat the fetch.
Files written by zabgrab store it as JSON (an HDF5 dataset, or # comment lines
in delimited files). update relies on its query and items.
Functions
|
Describe a fetch. |
|
Describe data exported from a file. |
- zabgrab.services.metadata.build_metadata(query, result, *, template, command, created)[source]¶
Describe a fetch. Never includes credentials.
- Parameters:
query (Query) – What was fetched, and where each setting came from.
result (FetchResult) – The data, and items skipped or failed.
template (Template or None) – The template used, copied in so the fetch can be understood (and updated with
--rematch) without the config.command (sequence of str) – The command line.
created (datetime) – When the fetch was made.
- Returns:
dict – The metadata, ready for JSON.
- Return type:
- zabgrab.services.metadata.export_metadata(dataset, *, source, filters, command, created)[source]¶
Describe data exported from a file.
The last group’s query is kept, so the export can be updated like the original, with the merged items and a record of how it was exported.
- Parameters:
- Returns:
dict – The metadata, ready for JSON.
- Return type: