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_id
str, optional Restricts serach to Versions of a specific Page
- chunk
integer, 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_size
integer, optional Number of items per chunk. (Under the hood, results are retrieved in “chunks”; this specifies how big those chunks are.)
- sort
listofstr, optional Fields to sort by in {field}:{order} format, e.g. capture_time:asc
- start_date
datetime, optional - end_date
datetime, optional - source_type
str, optional Such as ‘versionista’ or ‘internetarchive’
- hash
str, optional SHA-256 hash of Version content
- source_metadata
dict, optional Examples:
{'version_id': 12345678}{'account': 'versionista1', 'has_content': True}
- differentbool, optional
If False, include versions that aren’t actually different from the previous version of the same page in the response.
- include_change_from_previousbool, 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_earliestbool, 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_totalbool, 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)
- page_id
- Yields:
- version
dict Data about each found version.
- version