Read data from a given ``filepath`` with 'r' mode. Args: filepath (str or Path): Path to read data. encoding (str): The encoding format used to open the ``filepath``. Default: 'utf-8'. Returns: str: Expected text reading from ``fi
(uri: Union[str, Path], encoding: str = 'utf-8')
| 275 | |
| 276 | @staticmethod |
| 277 | def read_text(uri: Union[str, Path], encoding: str = 'utf-8') -> str: |
| 278 | """Read data from a given ``filepath`` with 'r' mode. |
| 279 | |
| 280 | Args: |
| 281 | filepath (str or Path): Path to read data. |
| 282 | encoding (str): The encoding format used to open the ``filepath``. |
| 283 | Default: 'utf-8'. |
| 284 | |
| 285 | Returns: |
| 286 | str: Expected text reading from ``filepath``. |
| 287 | """ |
| 288 | storage = File._get_storage(uri) |
| 289 | return storage.read_text(uri) |
| 290 | |
| 291 | @staticmethod |
| 292 | def write(obj: bytes, uri: Union[str, Path]) -> None: |