Download .venv/lib/python3.12/site-packages/icrawler/storage/base.py from FaustDerLegende/split: direct link, hf CLI and curl.
- Browser
- Download file 810 Bytes
-
https://huggingface.co/datasets/FaustDerLegende/split/resolve/main/.venv/lib/python3.12/site-packages/icrawler/storage/base.py
- Command line
-
hf download hf://datasets/FaustDerLegende/split/.venv/lib/python3.12/site-packages/icrawler/storage/base.py
-
curl -L -o base.py https://huggingface.co/datasets/FaustDerLegende/split/resolve/main/.venv/lib/python3.12/site-packages/icrawler/storage/base.py
810 Bytes
| from abc import ABCMeta, abstractmethod | |
| class BaseStorage: | |
| """Base class of backend storage""" | |
| __metaclass__ = ABCMeta | |
| def write(self, id, data): | |
| """Abstract interface of writing data | |
| Args: | |
| id (str): unique id of the data in the storage. | |
| data (bytes or str): data to be stored. | |
| """ | |
| return | |
| def exists(self, id): | |
| """Check the existence of some data | |
| Args: | |
| id (str): unique id of the data in the storage | |
| Returns: | |
| bool: whether the data exists | |
| """ | |
| return False | |
| def max_file_idx(self): | |
| """Get the max existing file index | |
| Returns: | |
| int: the max index | |
| """ | |
| return 0 | |