requests
download_as_str(url, parameters=None)
¶
Download a file as string in memory.
Returns:
Type | Description |
---|---|
str
|
The downloaded package as string. |
Source code in bag3d/common/utils/requests.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|
download_file(url, target_path, chunk_size=1024, parameters=None, verify=True)
¶
Download a large file and save it to disk.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url
|
str
|
The URL of the file to be downloaded. |
required |
target_path
|
Path
|
Path to the target file or directory. If |
required |
chunk_size
|
int
|
The |
1024
|
parameters
|
dict
|
Query parameters passed to :py:func: |
None
|
verify
|
bool
|
Whether to verify SSL certificate. |
True
|
Returns: The local Path to the downloaded file, or None on failure
Source code in bag3d/common/utils/requests.py
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 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|
get_extract_download_link(url, featuretypes, data_format, geofilter)
¶
Request an export and download link from the API.
Source code in bag3d/common/utils/requests.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
|
get_metadata(url_api)
¶
Get metadata from a PDOK API.
:returns: {"timeliness":
Source code in bag3d/common/utils/requests.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
|