Utils¶
Utils
¶
Bases: object
Helper class for main api classes
Source code in herepy/utils.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
build_url(url, extra_params=None)
staticmethod
¶
Builds a url with given parameters which will be used in requests.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
str
|
base url. |
required |
extra_params |
dict
|
dictionary of query parameters. |
None
|
Returns:
Type | Description |
---|---|
A encoded url ready for the request |
Source code in herepy/utils.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
encode_parameters(parameters)
staticmethod
¶
Return a string in key=value&key=value form. Values of None are not included in the output string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parameters |
dict
|
dictionary of query parameters to be converted. |
required |
Returns:
Type | Description |
---|---|
A URL-encoded string in "key=value&key=value" form |
Source code in herepy/utils.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|