mirror of
https://github.com/opendatalab/MinerU.git
synced 2026-09-21 20:49:56 +08:00
* feat: refractor cli command * feat: add docs to describe the output files of cli * feat: resove review comments * feat: updat docs about middle.json --------- Co-authored-by: shenguanlin <shenguanlin@pjlab.org.cn>
18 lines
452 B
Python
18 lines
452 B
Python
from abc import ABC, abstractmethod
|
|
|
|
|
|
class AbsReaderWriter(ABC):
|
|
MODE_TXT = "text"
|
|
MODE_BIN = "binary"
|
|
@abstractmethod
|
|
def read(self, path: str, mode=MODE_TXT):
|
|
raise NotImplementedError
|
|
|
|
@abstractmethod
|
|
def write(self, content: str, path: str, mode=MODE_TXT):
|
|
raise NotImplementedError
|
|
|
|
@abstractmethod
|
|
def read_offset(self, path: str, offset=0, limit=None) -> bytes:
|
|
raise NotImplementedError
|