# Copyright 2022 (c) Anna Schumaker. """Extra path handling for URIs.""" import pathlib import urllib def from_uri(uri: str) -> pathlib.Path: """Make a path from a uri.""" if parsed := urllib.parse.urlparse(uri): return pathlib.Path(urllib.parse.unquote(parsed.path)) return pathlib.Path(uri)