file_uri_to_path

file_uri_to_path(uri: str) Path | None[source]

Convert file uri to a path if the path exists.

Used to get the base path of local installations from source, e.g. pip install . .

Parameters:

uri (str) – Uri to a file e.g. ‘file:///tmp/dist

Returns:

Path of the file if it exists

Return type:

Path