file¶
Download strategy class for the file
scheme.
DownloadFileContent
¶
Bases: AttrDict
Class for returning values from Download File strategy.
Source code in oteapi/strategies/download/file.py
57 58 59 60 |
|
key = Field(..., description='Key to access the data in the cache.')
class-attribute
instance-attribute
¶
FileConfig
¶
Bases: AttrDict
File-specific Configuration Data Model.
Source code in oteapi/strategies/download/file.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
datacache_config = Field(None, description='Configurations for the data cache for storing the downloaded file content.')
class-attribute
instance-attribute
¶
encoding = Field(None, description='Encoding used when opening the file. The default is platform dependent.')
class-attribute
instance-attribute
¶
text = Field(False, description='Whether the file should be opened in text mode. If `False`, the file will be opened in bytes mode.')
class-attribute
instance-attribute
¶
FileResourceConfig
¶
Bases: ResourceConfig
File download strategy filter config.
Source code in oteapi/strategies/download/file.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
configuration = Field(FileConfig(), description='File download strategy-specific configuration.')
class-attribute
instance-attribute
¶
downloadUrl = Field(..., description='The file URL, which will be downloaded.')
class-attribute
instance-attribute
¶
ensure_path_exists(value)
classmethod
¶
Ensure path
is defined in downloadUrl
.
Source code in oteapi/strategies/download/file.py
48 49 50 51 52 53 54 |
|
FileStrategy
¶
Strategy for retrieving data from a local file.
Registers strategies:
("scheme", "file")
Source code in oteapi/strategies/download/file.py
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 95 96 |
|
download_config
instance-attribute
¶
get()
¶
Read local file.
Source code in oteapi/strategies/download/file.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
|
initialize()
¶
Initialize.
Source code in oteapi/strategies/download/file.py
75 76 77 |
|