URIs

pygls.uris.from_fs_path(path)

Returns a URI for the given filesystem path.

Parameters:

path (str)

pygls.uris.to_fs_path(uri)

Returns the filesystem path of the given URI.

Will handle UNC paths and normalize windows drive letters to lower-case. Also uses the platform specific path separator. Will not validate the path for invalid characters and semantics.

Parameters:

uri (str)

Return type:

str | None

pygls.uris.uri_scheme(uri)
Parameters:

uri (str)

pygls.uris.uri_with(uri, scheme=None, netloc=None, path=None, params=None, query=None, fragment=None)

Return a URI with the given part(s) replaced. Parts are decoded / encoded.

Parameters:
  • uri (str)

  • scheme (str | None)

  • netloc (str | None)

  • path (str | None)

  • params (str | None)

  • query (str | None)

  • fragment (str | None)

pygls.uris.urlparse(uri)

Parse and decode the parts of a URI.

Parameters:

uri (str)

pygls.uris.urlunparse(parts)

Unparse and encode parts of a URI.

Parameters:

parts (Tuple[str, str, str, str, str, str])

Return type:

str