url_utils module

Various utilities needed for sitemap parsing.

url_utils.get_path_components(path)

Separate the parent/child components from a path.

Parameters

path (str) – path to process

Returns

dictionary containing the parent and child of the path

Return type

dict

url_utils.get_path_from_url(url)

Extract the path from a URL.

Parameters

url (str) – URL for a resource

Returns

path extracted from the URL

Return type

str

url_utils.make_output_dir(path)

Create an output directory if none exists.

Parameters

path (str) – path of the output directory to create