This document is for Kombu's development version, which can be significantly different from previous releases. Get the stable docs here: 5.3.

URL Utilities - kombu.utils.url

URL Utilities.

kombu.utils.url.as_url(scheme: str, host: str | None = None, port: int | None = None, user: str | None = None, password: str | None = None, path: str | None = None, query: str | None = None, sanitize: bool = False, mask: str = '**') str[source]

Generate URL from component parts.

kombu.utils.url.maybe_sanitize_url(url: Any, mask: str = '**') Any[source]

Sanitize url, or do nothing if url undefined.

kombu.utils.url.parse_ssl_cert_reqs(query_value: str) Any[source]

Given the query parameter for ssl_cert_reqs, return the SSL constant or None.

kombu.utils.url.parse_url(url: str) Dict[source]

Parse URL into mapping of components.

kombu.utils.url.sanitize_url(url: str, mask: str = '**') str[source]

Return copy of URL with password removed.

kombu.utils.url.url_to_parts(url: str) urlparts[source]

Parse URL into urlparts tuple of components.

class kombu.utils.url.urlparts(scheme: str, hostname: str, port: int, username: str, password: str, path: str, query: Mapping)[source]

Named tuple representing parts of the URL.

hostname: str

Alias for field number 1

password: str

Alias for field number 4

path: str

Alias for field number 5

port: int

Alias for field number 2

query: Mapping

Alias for field number 6

scheme: str

Alias for field number 0

username: str

Alias for field number 3