from yarl import URL url = URL('https://www.example.com/path') print(url)
url = url.with_query({'param1': 'value1', 'param2': 'value2'}) print(url)
print(url.host) # www.example.com print(url.path) # /path print(url.query) # {'param1': 'value1', 'param2': 'value2'}In these examples, yarl is used as the package/library to construct and manipulate URLs.