Skip to content

Instantly share code, notes, and snippets.

@digitalashes
Created November 29, 2017 19:24
Show Gist options
  • Save digitalashes/c6bb2b51750f26609985cb0269d9af26 to your computer and use it in GitHub Desktop.
Save digitalashes/c6bb2b51750f26609985cb0269d9af26 to your computer and use it in GitHub Desktop.
def url(self, url):
"""
An internal method for build url
"""
endpoint_url = provider['url'].replace('{format}', data_format)
scheme, netloc, path, qs, fragment = urlsplit(endpoint_url)
query_params = OrderedDict(parse_qsl(qs))
query_params['url'] = url
if self._params:
query_params.update(self._params)
query_params = urlencode(query_params, True)
return urlunsplit((scheme, netloc, path, query_params, fragment))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment