Skip to content

Releases: mementoweb/py-memento-client

v0.6.1

30 Jul 15:17
Compare
Choose a tag to compare

This release contains major updates with some bug fixes to the library and new unit tests.

v0.5.3

13 Oct 16:37
Compare
Choose a tag to compare

Version 0.5.3 is a minor update with the following functionality:

  • support for Python 3.5
  • fix for defect whereby a nonexistent live URI is processed differently on Linux vs OSX
  • workaround for a defect in the requests library where it acts differently on Linux vs OSX

Enjoy the new py-memento-client the next time you need to use Memento in Python.

v0.5.2

08 Oct 23:55
Compare
Choose a tag to compare

Today we proudly announce version 0.5.2 of the py-memento-client library available for Python. This library has been developed with extensive feedback from Wikipedia and is used by their pywikibot.

Source repository: https://github.com/mementoweb/py-memento-client
Pypi page: https://pypi.python.org/pypi/memento_client/0.5.1
Report issues here: https://github.com/mementoweb/py-memento-client/issues

Our goal was to make a memento client library that was easy to use for those new to Memento, but that also provided more advanced parameters for use by the initiated.

To install the library, merely run the following command:

    pip install memento_client

The simple use case of this library is as follows:

    import datetime
    from memento_client import MementoClient
    dt = datetime.datetime(2010, 4, 24, 19, 0)
    uri = "http://lanl.gov"
    mc = MementoClient()
    uri_m = mc.get_memento_info(uri, dt).get("mementos").get("closest").get("uri")[0]

Version 0.5.2 is a minor update with the following functionality:

  • support for Python 3.5
  • fix for defect whereby a nonexistent live URI is processed differently on Linux vs OSX

Enjoy the new py-memento-client the next time you need to use Memento in Python.

v0.5.1

17 Aug 21:19
Compare
Choose a tag to compare

Today we proudly announce version 0.5.1 of the py-memento-client library available for Python. This library has been developed with extensive feedback from Wikipedia and is used by their pywikibot.

Source repository: https://github.com/mementoweb/py-memento-client
Pypi page: https://pypi.python.org/pypi/memento_client/0.5.1
Report issues here: https://github.com/mementoweb/py-memento-client/issues

Our goal was to make a memento client library that was easy to use for those new to Memento, but that also provided more advanced parameters for use by the initiated.

To install the library, merely run the following command:

    pip install memento_client

The simple use case of this library is as follows:

    import datetime
    from memento_client import MementoClient
    dt = datetime.datetime(2010, 4, 24, 19, 0)
    uri = "http://lanl.gov"
    mc = MementoClient()
    uri_m = mc.get_memento_info(uri, dt).get("mementos").get("closest").get("uri")[0]

Version 0.5.1 supports the following functionality:

  • 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.