urlstd.parse.Origin#

class urlstd.parse.Origin(scheme: str, host: str | int | tuple[int, ...] | None, port: int | None, domain: str | None)

Bases: NamedTuple

A named tuple that represents the origin of the URL.

Methods:

__str__()

Returns a string representation of the origin.

is_same_origin(other)

Returns True if other can be said to be of same origin as this object.

is_same_origin_domain(other)

Returns True if other can be said to be of same origin-domain as this object.

Attributes:

domain

A URL’s domain.

host

A URL’s host.

port

A URL’s port.

scheme

A URL’s scheme.