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
59 60 61 62 |
|
key: str = 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
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
|
datacache_config: Optional[DataCacheConfig] = Field(None, description='Configurations for the data cache for storing the downloaded file content.')
class-attribute
instance-attribute
¶
encoding: Optional[str] = Field(None, description='Encoding used when opening the file. The default is platform dependent.')
class-attribute
instance-attribute
¶
text: bool = 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
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
|
configuration: FileConfig = Field(FileConfig(), description='File download strategy-specific configuration.')
class-attribute
instance-attribute
¶
downloadUrl: FileUrl = 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
50 51 52 53 54 55 56 |
|
FileStrategy
¶
Strategy for retrieving data from a local file.
Registers strategies:
("scheme", "file")
Source code in oteapi/strategies/download/file.py
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 97 98 |
|
download_config: FileResourceConfig
instance-attribute
¶
get()
¶
Read local file.
Source code in oteapi/strategies/download/file.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
|
initialize()
¶
Initialize.
Source code in oteapi/strategies/download/file.py
77 78 79 |
|