gigl.common.types.uri.HttpUri#

class gigl.common.types.uri.http_uri.HttpUri(uri: str | Path | HttpUri)#

Bases: Uri

Represents an HTTP URI.

Methods

__init__

get_basename

The base name is the final component of the path, effectively extracting the file or directory name from a full path string.

is_valid

Check if the URI is valid.

join

Join multiple URI tokens into a single URI.

__eq__(other: Any) bool#

Return self==value.

__hash__() int#

Return hash(self).

__init__(uri: str | Path | HttpUri) None#
__repr__() str#

Return repr(self).

__weakref__#

list of weak references to the object (if defined)

get_basename() str#

The base name is the final component of the path, effectively extracting the file or directory name from a full path string. i.e. get_basename(“/foo/bar.txt”) -> bar.txt get_basename(“gs://bucket/foo”) -> foo

classmethod is_valid(uri: str | Path | Uri, raise_exception: bool = False) bool#

Check if the URI is valid.

Args:

uri: The URI to check. raise_exception: Whether to raise an exception if the URI is invalid.

Returns:

bool: True if the URI is valid, False otherwise.

classmethod join(token: str | Path | Uri, *tokens: str | Path | Uri) HttpUri#

Join multiple URI tokens into a single URI.

Args:

token: The first URI token. *tokens: Additional URI tokens to join.

Returns:

HttpUri: The joined URI.