urlstd.parse.URLRecord#

class urlstd.parse.URLRecord(scheme: str = '', username: str = '', password: str = '', host: str | int | tuple[int, ...] | None = None, port: int | None = None, path: list[str] | str = <factory>, query: str | None = None, fragment: str | None = None, blob_url_entry: str | None = None)

Bases: object

A data class that represents a universal identifier.

Methods:

__eq__(other)

Returns True if other is equal to this object.

__str__()

Returns a string representation of a URL.

cannot_have_username_password_port()

Returns True if a URL’s host is None, the empty string, or scheme is "file".

equals(other[, exclude_fragments])

Returns True if other is equal to this object.

has_opaque_path()

Returns True if a URL has an opaque path.

includes_credentials()

Returns True if a URL’s username or password is not the empty string.

is_not_special()

Returns True if a URL’s scheme is not a special scheme ("ftp", "file", "http", "https", "ws", or "wss").

is_special()

Returns True if a URL’s scheme is a special scheme ("ftp", "file", "http", "https", "ws", or "wss").

serialize_host()

Returns a string representation of a URL’s host.

serialize_path()

Returns a string representation of a URL’s path.

serialize_url([exclude_fragment])

Returns a string representation of a URL.

shorten_path()

Shortens a URL’s path.

Attributes:

blob_url_entry

A URL’s blob URL entry.

fragment

A URL’s fragment.

host

A URL’s host.

href

Returns a string representation of a URL.

origin

Returns a URL’s origin or None as an opaque origin.

password

A URL’s password.

port

A URL’s port.

query

A URL’s query.

scheme

A URL’s scheme.

username

A URL’s username.

path

A URL’s path.