web_monitoring.db.Client.get_versions¶
-
Client.
get_versions
(*, page_id=None, chunk=None, chunk_size=None, sort=None, start_date=None, end_date=None, source_type=None, hash=None, source_metadata=None, different=None, include_change_from_previous=None, include_change_from_earliest=None, include_total=False)[source]¶ Iterate over a set of versions, optionally filtered by search criteria.
Any metadata about each paginated chunk of results is available on the “_list_meta” field of each version, e.g:
>>> pages = client.get_versions(include_total=True) >>> next(pages)['_list_meta'] {'total_results': 123456}
- Parameters
- page_idstring, optional
Restricts serach to Versions of a specific Page
- chunkinteger, optional
Pagination chunk to start iterating from. If unset, starts at the beginning of the result set. (Under the hood, results are retrieved in “chunks”; using this to skip partway into the results is more optimized that skipping over the first few items in the iterable.)
- chunk_sizeinteger, optional
Number of items per chunk. (Under the hood, results are retrieved in “chunks”; this specifies how big those chunks are.)
- sortlist of string, optional
Fields to sort by in {field}:{order} format, e.g. capture_time:asc
- start_datedatetime, optional
- end_datedatetime, optional
- source_typestring, optional
Such as ‘versionista’ or ‘internetarchive’
- hashstring, optional
SHA-256 hash of Version content
- source_metadatadict, optional
Examples:
{'version_id': 12345678}
{'account': 'versionista1', 'has_content': True}
- differentboolean, optional
If False, include versions that aren’t actually different from the previous version of the same page in the response.
- include_change_from_previousboolean, optional
If True, include a change_from_previous field in each version that represents a change object between it and the previous version of the same page.
- include_change_from_earliestboolean, optional
If True, include a change_from_earliest field in each version that represents a change object between it and the earliest version of the same page.
- include_totalboolean, optional
Whether to include a meta.total_results field in the response. If not set, links.last will usually be empty unless you are on the last chunk. Setting this option runs a pretty expensive query, so use it sparingly. (Default: False)
- Yields
- versiondict
Data about each found version.