facile_rs.utils.http¶
Module Contents¶
Functions¶
Fetch files from local locations or a URLs and save them at the given path. |
|
Fetch data from a JSON or YAML file and return it as a dictionary. |
|
Fetch JSON data from the given location. |
Data¶
API¶
- logger = 'getLogger(...)'¶
- fetch_files(locations, path)¶
Fetch files from local locations or a URLs and save them at the given path.
- Parameters:
locations – list of URL or paths to the files
path (str) – location where the files should be saved
- fetch_dict(location)¶
Fetch data from a JSON or YAML file and return it as a dictionary.
- Parameters:
location (str) – URL or path to the file (allowed extensions: .json, .yml, .yaml)
- Returns:
Dictionary containing file data
- Return type:
dict
- fetch_json(location)¶
Fetch JSON data from the given location.
- Parameters:
location (str) – URL to the JSON data
- Returns:
JSON-encoded response