Coverage for oc_ds_converter / oc_idmanager / oc_data_storage / storage_manager.py: 67%
21 statements
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-25 18:06 +0000
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-25 18:06 +0000
1# SPDX-FileCopyrightText: 2023 Arianna Moretti <arianna.moretti4@unibo.it>
2# SPDX-FileCopyrightText: 2026 Arcangelo Massari <arcangelo.massari@unibo.it>
3#
4# SPDX-License-Identifier: ISC
7from abc import ABCMeta
10class StorageManager(metaclass=ABCMeta):
11 """This is the interface that must be implemented by any Storage manager
12 for a particular storage approach. It provides the signatures of the methods
13 for string and retrieving data."""
15 _headers: dict[str, str]
17 def __init__(self, **params: object) -> None:
18 """Storage manager constructor."""
19 for key in params:
20 setattr(self, key, params[key])
22 self._headers = {
23 "User-Agent": "Identifier Manager / OpenCitations Indexes "
24 "(http://opencitations.net; mailto:contact@opencitations.net)"
25 }
27 def set_value(self, id: str, value: bool) -> None:
28 pass
30 def set_full_value(self, id: str, value: dict[str, str | bool | object]) -> None:
31 pass
33 def get_value(self, id: str) -> bool | None:
34 pass
36 def set_multi_value(self, list_of_tuples: list[tuple[str, bool]]) -> None:
37 pass
39 def delete_storage(self) -> None:
40 pass
42 def store_file(self) -> None:
43 pass
45 def get_all_keys(self) -> list[str]:
46 return []