Skip to content

Add top-level convenience functions #149

@Mr0grog

Description

@Mr0grog

Today, you have to create a WaybackClient instance in order to do anything with this library. We should add convenience functions that mirror the search() and get_memento() methods on clients (and whatever other methods might be added to WaybackClient in the future) so you can just call methods without needing to instantiate a client or session:

from datetime import datetime
import wayback

wayback.get_memento('https://nasa.gov/', datetime(2016, 12, 31))

I think these would use ideally use some sort of shared client or session under the hood rather than each call creating and destroying a whole client, although that might cause some issues with leaving some connections open/hanging — needs investigation.

Depends on getting thread safety first in #58.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Prioritized

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions