Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add top-level convenience functions #149

Open
Mr0grog opened this issue Dec 13, 2023 · 0 comments
Open

Add top-level convenience functions #149

Mr0grog opened this issue Dec 13, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@Mr0grog
Copy link
Member

Mr0grog commented Dec 13, 2023

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.

@Mr0grog Mr0grog added the enhancement New feature or request label Dec 13, 2023
@Mr0grog Mr0grog moved this to Unreleased in Wayback Roadmap Dec 13, 2023
@Mr0grog Mr0grog moved this from Unreleased to Prioritized in Wayback Roadmap Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Prioritized
Development

No branches or pull requests

1 participant