Created
March 30, 2021 00:39
-
-
Save eyeseast/bfcfa2a32e1b7599fcbec6d3f4818a8d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from urllib.parse import urlparse | |
from datasette import hookimpl | |
def urlextract(uri, part): | |
u = urlparse(uri) | |
return getattr(u, part) | |
@hookimpl | |
def prepare_connection(conn): | |
conn.create_function("urlextract", 2, urlextract) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment