@@ -352,70 +352,6 @@ def _iterate_chunk_items(self, method, url, data=None, timeout=None, **kwargs):
352352
353353 ### PAGES ###
354354
355- def list_pages (self , * , chunk = None , chunk_size = None , sort = None ,
356- tags = None , maintainers = None , url = None , title = None ,
357- include_versions = None , include_earliest = None ,
358- include_latest = None , source_type = None , hash = None ,
359- start_date = None , end_date = None , active = None ,
360- include_total = False ):
361- """
362- List all Pages, optionally filtered by search criteria.
363-
364- Parameters
365- ----------
366- chunk : integer, optional
367- pagination parameter
368- chunk_size : integer, optional
369- number of items per chunk
370- sort : list of string, optional
371- fields to sort by in `{field}:{order}` format, e.g. `title:asc`
372- tags : list of string, optional
373- maintainers : list of string, optional
374- url : string, optional
375- title : string, optional
376- include_versions : boolean, optional
377- include_earliest : boolean, optional
378- include_latest : boolean, optional
379- source_type : string, optional
380- such as 'versionista' or 'internet_archive'
381- hash : string, optional
382- SHA256 hash of Version content
383- start_date : datetime, optional
384- end_date : datetime, optional
385- active : boolean, optional
386- include_total : boolean, optional
387- Whether to include a `meta.total_results` field in the response.
388- If not set, `links.last` will usually be empty unless you are on
389- the last chunk. Setting this option runs a pretty expensive query,
390- so use it sparingly. (Default: False)
391-
392- Returns
393- -------
394- response : dict
395- """
396- warnings .warn ('db.client.list_pages() has been deprecated. Please use '
397- 'db.client.get_pages().' ,
398- DeprecationWarning )
399-
400- params = {'chunk' : chunk ,
401- 'chunk_size' : chunk_size ,
402- 'sort' : sort and ',' .join (sort ) or None ,
403- 'tags[]' : tags ,
404- 'maintainers[]' : maintainers ,
405- 'url' : url ,
406- 'title' : title ,
407- 'include_versions' : include_versions ,
408- 'include_earliest' : include_earliest ,
409- 'include_latest' : include_latest ,
410- 'source_type' : source_type ,
411- 'hash' : hash ,
412- 'capture_time' : _time_range_string (start_date , end_date ),
413- 'active' : active ,
414- 'include_total' : include_total or None }
415- url = '/pages'
416- result = self .request_json (GET , url , params = params )
417- return result
418-
419355 def get_pages (self , * , chunk = None , chunk_size = None , sort = None ,
420356 tags = None , maintainers = None , url = None , title = None ,
421357 include_versions = None , include_earliest = None ,
@@ -507,82 +443,6 @@ def get_page(self, page_id):
507443
508444 ### VERSIONS ###
509445
510- def list_versions (self , * , page_id = None , chunk = None , chunk_size = None ,
511- sort = None , start_date = None , end_date = None ,
512- source_type = None , hash = None ,
513- source_metadata = None , different = None ,
514- include_change_from_previous = None ,
515- include_change_from_earliest = None , include_total = False ):
516- """
517- List Versions, optionally filtered by serach criteria, including Page.
518-
519- Parameters
520- ----------
521- page_id : string, optional
522- restricts serach to Versions of a specific Page
523- chunk : integer, optional
524- pagination parameter
525- chunk_size : integer, optional
526- number of items per chunk
527- sort : list of string, optional
528- fields to sort by in `{field}:{order}` format,
529- e.g. `capture_time:asc`
530- start_date : datetime, optional
531- end_date : datetime, optional
532- source_type : string, optional
533- such as 'versionista' or 'internetarchive'
534- hash : string, optional
535- SHA256 hash of Version content
536- source_metadata : dict, optional
537- Examples:
538-
539- * ``{'version_id': 12345678}``
540- * ``{'account': 'versionista1', 'has_content': True}``
541- different : boolean, optional
542- If False, include versions that aren't actually different from the
543- previous version of the same page in the response.
544- include_change_from_previous : boolean, optional
545- If True, include a `change_from_previous` field in each version
546- that represents a change object between it and the previous version
547- of the same page.
548- include_change_from_earliest : boolean, optional
549- If True, include a `change_from_earliest` field in each version
550- that represents a change object between it and the earliest version
551- of the same page.
552- include_total : boolean, optional
553- Whether to include a `meta.total_results` field in the response.
554- If not set, `links.last` will usually be empty unless you are on
555- the last chunk. Setting this option runs a pretty expensive query,
556- so use it sparingly. (Default: False)
557-
558- Returns
559- -------
560- response : dict
561- """
562- warnings .warn ('db.client.list_versions() has been deprecated. Please '
563- 'use db.client.get_versions().' ,
564- DeprecationWarning )
565-
566- params = {'chunk' : chunk ,
567- 'chunk_size' : chunk_size ,
568- 'sort' : sort and ',' .join (sort ) or None ,
569- 'capture_time' : _time_range_string (start_date , end_date ),
570- 'source_type' : source_type ,
571- 'hash' : hash ,
572- 'different' : different ,
573- 'include_change_from_previous' : include_change_from_previous ,
574- 'include_change_from_earliest' : include_change_from_earliest ,
575- 'include_total' : include_total or None }
576- if source_metadata is not None :
577- for k , v in source_metadata .items ():
578- params [f'source_metadata[{ k } ]' ] = v
579- if page_id is None :
580- url = '/versions'
581- else :
582- url = f'/pages/{ page_id } /versions'
583- result = self .request_json (GET , url , params = params )
584- return result
585-
586446 def get_versions (self , * , page_id = None , chunk = None , chunk_size = None ,
587447 sort = None , start_date = None , end_date = None ,
588448 source_type = None , hash = None ,
@@ -860,32 +720,6 @@ def get_import_status(self, import_id):
860720
861721 ### CHANGES AND ANNOTATIONS ###
862722
863- def list_changes (self , page_id , include_total = False ):
864- """
865- List Changes between two Versions on a Page.
866-
867- Parameters
868- ----------
869- page_id : string
870- include_total : bool, optional
871- Whether to include a `meta.total_results` field in the response.
872- If not set, `links.last` will usually be empty unless you are on
873- the last chunk. Setting this option runs a pretty expensive query,
874- so use it sparingly. (Default: False)
875-
876- Returns
877- -------
878- response : dict
879- """
880- warnings .warn ('db.client.list_changes() has been deprecated. Please '
881- 'use db.client.get_changes().' ,
882- DeprecationWarning )
883-
884- url = f'/pages/{ page_id } /changes/'
885- result = self .request_json (
886- GET , url , params = {'include_total' : include_total or None })
887- return result
888-
889723 def get_changes (self , page_id , include_total = False ):
890724 """
891725 Iterate through a set of changes between any two versions of a page.
@@ -928,38 +762,6 @@ def get_change(self, *, page_id, to_version_id, from_version_id=''):
928762 result = self .request_json (GET , url )
929763 return result
930764
931- def list_annotations (self , * , page_id , to_version_id , from_version_id = '' ,
932- include_total = False ):
933- """
934- List Annotations for a Change between two Versions.
935-
936- Parameters
937- ----------
938- page_id : string
939- to_version_id : string
940- from_version_id : string, optional
941- If from_version_id is not given, it will be treated as version
942- immediately prior to ``to_version``.
943- include_total : boolean, optional
944- Whether to include a `meta.total_results` field in the response.
945- If not set, `links.last` will usually be empty unless you are on
946- the last chunk. Setting this option runs a pretty expensive query,
947- so use it sparingly. (Default: False)
948-
949- Returns
950- -------
951- response : dict
952- """
953- warnings .warn ('db.client.list_annotations() has been deprecated. '
954- 'Please use db.client.get_annotations().' ,
955- DeprecationWarning )
956-
957- url = (f'/pages/{ page_id } /changes/'
958- f'{ from_version_id } ..{ to_version_id } /annotations' )
959- result = self .request_json (
960- GET , url , params = {'include_total' : include_total or None })
961- return result
962-
963765 def get_annotations (self , * , page_id , to_version_id , from_version_id = '' ,
964766 include_total = False ):
965767 """
0 commit comments