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

URL Utilities - kombu.utils.url

URL Utilities.

kombu.utils.url.as_url(scheme: str, host: Optional[str] = None, port: Optional[int] = None, user: Optional[str] = None, password: Optional[str] = None, path: Optional[str] = None, query: Optional[str] = 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) kombu.utils.url.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: collections.abc.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: collections.abc.Mapping

Alias for field number 6

scheme: str

Alias for field number 0

username: str

Alias for field number 3