- support for Python 2.7 and 3.4
- a MementoClient class that, by default, uses the Memento Aggregator as a TimeGate
- the MementoClient class provides the following methods:
- get_memento_info - performs datetime negotiation using inputs URI-R and Accept-Datetime; output resembles the JSON API documented at http://timetravel.mementoweb.org/guide/api/memento-json
- get_native_timegate_uri - issues request to URI-R and extracts value for URI-G from Link header (used for CMS systems)
- get_original_uri - issues request to URI and extracts value of URI-R from Link header
- the MementoClient class provides the following optional initialization parameters:
- user-supplied timegate (URI-G) for use in datetime negotiation
- boolean to turn off the use of native TimeGates supplied in Memento headers, so one can override the TimeGate information supplied by a CMS
- configurable number of redirects to follow (default is 30)
- in addition, here is a short list of some of the static functions available:
- is_timegate - determines if a given URI, or user-supplied HTTP response, is a TimeGate by examining the Link headers
- is_memento - determines if a given URI, or user-supplied HTTP response, is a Memento by examining the headers
- parse_link_header - parses the link header to return any and all information available as a Python dictionary
- get_uri_dt_for_rel - pivots the output of parse_link_header to form a dictionary whose keys are relations
By our next version, we will provide the ability to perform as a client for TimeMaps, providing functionality for parsing and interacting with TimeMaps.
Enjoy the new py-memento-client the next time you need to use Memento in Python.