rloader
ensembl.utils.rloader
¶
Allow to seamlessly load / read the content of a remote file as if it was located locally.
logger = logging.getLogger(__name__)
module-attribute
¶
RemoteFileLoader
¶
Loads remote files, allowing specific format parsing options.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parser
|
Optional[str]
|
Parser to use for this object. Default: |
None
|
Attributes:
Name | Type | Description |
---|---|---|
available_formats |
set[str]
|
File formats with ad-hoc parsers available. |
parser |
Optional[str]
|
Parser selected for this object. |
Source code in src/ensembl/utils/rloader.py
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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
available_formats: set[str] = {'yaml', 'ini', 'env', 'json'}
class-attribute
instance-attribute
¶
parser: Optional[str] = None
class-attribute
instance-attribute
¶
r_open(url)
¶
Returns the parsed remote file from the given URL.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url
|
str
|
URL of the remote file to fetch. |
required |
Raises:
Type | Description |
---|---|
HTTPError
|
If loading or requesting the given URL returned an error. |
Timeout
|
If a timeout was raised whilst requesting the given URL. |
Source code in src/ensembl/utils/rloader.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|