funapi-sciencedb 1.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. funapi_sciencedb-1.0.1.dist-info/LICENSE +21 -0
  2. funapi_sciencedb-1.0.1.dist-info/METADATA +10 -0
  3. funapi_sciencedb-1.0.1.dist-info/RECORD +54 -0
  4. funapi_sciencedb-1.0.1.dist-info/WHEEL +5 -0
  5. funapi_sciencedb-1.0.1.dist-info/top_level.txt +1 -0
  6. sciencedb/__init__.py +8 -0
  7. sciencedb/api/__init__.py +1 -0
  8. sciencedb/api/open_api_controller/__init__.py +0 -0
  9. sciencedb/api/open_api_controller/harvest_using_get.py +211 -0
  10. sciencedb/api/open_api_controller/json_using_get.py +164 -0
  11. sciencedb/api/open_api_controller/metrics_using_get.py +166 -0
  12. sciencedb/api/open_api_controller/search_using_get.py +196 -0
  13. sciencedb/api/sushi_controller/__init__.py +0 -0
  14. sciencedb/api/sushi_controller/get_api_status.py +171 -0
  15. sciencedb/api/sushi_controller/get_report_by_id_using_get.py +173 -0
  16. sciencedb/api/sushi_controller/get_reports.py +181 -0
  17. sciencedb/client.py +286 -0
  18. sciencedb/errors.py +16 -0
  19. sciencedb/models/__init__.py +75 -0
  20. sciencedb/models/api_result_metrics_result.py +99 -0
  21. sciencedb/models/api_result_search_result.py +99 -0
  22. sciencedb/models/counter_dataset_attributes.py +69 -0
  23. sciencedb/models/counter_dataset_attributes_type.py +10 -0
  24. sciencedb/models/counter_dataset_contributors.py +68 -0
  25. sciencedb/models/counter_dataset_contributors_type.py +10 -0
  26. sciencedb/models/counter_dataset_dates.py +68 -0
  27. sciencedb/models/counter_dataset_dates_type.py +10 -0
  28. sciencedb/models/counter_dataset_identifiers.py +68 -0
  29. sciencedb/models/counter_dataset_identifiers_type.py +10 -0
  30. sciencedb/models/counter_dataset_instance.py +98 -0
  31. sciencedb/models/counter_dataset_instance_access_method.py +9 -0
  32. sciencedb/models/counter_dataset_instance_metric_type.py +11 -0
  33. sciencedb/models/counter_dataset_performance.py +82 -0
  34. sciencedb/models/counter_dataset_period.py +83 -0
  35. sciencedb/models/counter_dataset_report.py +106 -0
  36. sciencedb/models/counter_dataset_usage.py +230 -0
  37. sciencedb/models/counter_dataset_usage_data_type.py +8 -0
  38. sciencedb/models/counter_publisher_identifiers.py +68 -0
  39. sciencedb/models/counter_publisher_identifiers_type.py +10 -0
  40. sciencedb/models/metrics_result.py +95 -0
  41. sciencedb/models/search_record.py +150 -0
  42. sciencedb/models/search_result.py +111 -0
  43. sciencedb/models/sushi_error_model.py +97 -0
  44. sciencedb/models/sushi_error_model_severity.py +11 -0
  45. sciencedb/models/sushi_page_meta.py +77 -0
  46. sciencedb/models/sushi_report.py +72 -0
  47. sciencedb/models/sushi_report_header.py +189 -0
  48. sciencedb/models/sushi_report_header_report_attributes_item.py +43 -0
  49. sciencedb/models/sushi_report_header_report_filters_item.py +43 -0
  50. sciencedb/models/sushi_report_list.py +82 -0
  51. sciencedb/models/sushi_report_page.py +93 -0
  52. sciencedb/models/sushi_service_status.py +118 -0
  53. sciencedb/models/sushi_service_status_alerts_item.py +43 -0
  54. sciencedb/types.py +53 -0
@@ -0,0 +1,93 @@
1
+ from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ from ..types import UNSET, Unset
7
+
8
+ if TYPE_CHECKING:
9
+ from ..models.sushi_page_meta import SUSHIPageMeta
10
+ from ..models.sushi_report_list import SUSHIReportList
11
+
12
+
13
+ T = TypeVar("T", bound="SUSHIReportPage")
14
+
15
+
16
+ @_attrs_define
17
+ class SUSHIReportPage:
18
+ """page wrapper of reports
19
+
20
+ Attributes:
21
+ reports (Union[Unset, List['SUSHIReportList']]): list of reports
22
+ meta (Union[Unset, SUSHIPageMeta]): page wrapper of reports
23
+ """
24
+
25
+ reports: Union[Unset, List["SUSHIReportList"]] = UNSET
26
+ meta: Union[Unset, "SUSHIPageMeta"] = UNSET
27
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
28
+
29
+ def to_dict(self) -> Dict[str, Any]:
30
+ reports: Union[Unset, List[Dict[str, Any]]] = UNSET
31
+ if not isinstance(self.reports, Unset):
32
+ reports = []
33
+ for reports_item_data in self.reports:
34
+ reports_item = reports_item_data.to_dict()
35
+ reports.append(reports_item)
36
+
37
+ meta: Union[Unset, Dict[str, Any]] = UNSET
38
+ if not isinstance(self.meta, Unset):
39
+ meta = self.meta.to_dict()
40
+
41
+ field_dict: Dict[str, Any] = {}
42
+ field_dict.update(self.additional_properties)
43
+ field_dict.update({})
44
+ if reports is not UNSET:
45
+ field_dict["reports"] = reports
46
+ if meta is not UNSET:
47
+ field_dict["meta"] = meta
48
+
49
+ return field_dict
50
+
51
+ @classmethod
52
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
53
+ from ..models.sushi_page_meta import SUSHIPageMeta
54
+ from ..models.sushi_report_list import SUSHIReportList
55
+
56
+ d = src_dict.copy()
57
+ reports = []
58
+ _reports = d.pop("reports", UNSET)
59
+ for reports_item_data in _reports or []:
60
+ reports_item = SUSHIReportList.from_dict(reports_item_data)
61
+
62
+ reports.append(reports_item)
63
+
64
+ _meta = d.pop("meta", UNSET)
65
+ meta: Union[Unset, SUSHIPageMeta]
66
+ if isinstance(_meta, Unset):
67
+ meta = UNSET
68
+ else:
69
+ meta = SUSHIPageMeta.from_dict(_meta)
70
+
71
+ sushi_report_page = cls(
72
+ reports=reports,
73
+ meta=meta,
74
+ )
75
+
76
+ sushi_report_page.additional_properties = d
77
+ return sushi_report_page
78
+
79
+ @property
80
+ def additional_keys(self) -> List[str]:
81
+ return list(self.additional_properties.keys())
82
+
83
+ def __getitem__(self, key: str) -> Any:
84
+ return self.additional_properties[key]
85
+
86
+ def __setitem__(self, key: str, value: Any) -> None:
87
+ self.additional_properties[key] = value
88
+
89
+ def __delitem__(self, key: str) -> None:
90
+ del self.additional_properties[key]
91
+
92
+ def __contains__(self, key: str) -> bool:
93
+ return key in self.additional_properties
@@ -0,0 +1,118 @@
1
+ from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ from ..types import UNSET, Unset
7
+
8
+ if TYPE_CHECKING:
9
+ from ..models.sushi_service_status_alerts_item import SUSHIServiceStatusAlertsItem
10
+
11
+
12
+ T = TypeVar("T", bound="SUSHIServiceStatus")
13
+
14
+
15
+ @_attrs_define
16
+ class SUSHIServiceStatus:
17
+ """
18
+ Attributes:
19
+ service_active (bool): Indicator if the service is currently able to deliver reports. Example: True.
20
+ alerts (Union[Unset, List['SUSHIServiceStatusAlertsItem']]): Any alerts related to service interuptions and
21
+ status.
22
+ description (Union[Unset, str]): Description of the service. Example: COUNTER Research Data Usage Reports for
23
+ the UK Data Service - ReShare..
24
+ note (Union[Unset, str]): A general note about the service. Example: A given customer can request a maximum of 5
25
+ requests per day for a given report.
26
+ registry_url (Union[Unset, str]): If available, the URL separate registry with additional information about the
27
+ service. Example: https://www.projectcounter.org/counter-user/ebsco-database/.
28
+ """
29
+
30
+ service_active: bool
31
+ alerts: Union[Unset, List["SUSHIServiceStatusAlertsItem"]] = UNSET
32
+ description: Union[Unset, str] = UNSET
33
+ note: Union[Unset, str] = UNSET
34
+ registry_url: Union[Unset, str] = UNSET
35
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
36
+
37
+ def to_dict(self) -> Dict[str, Any]:
38
+ service_active = self.service_active
39
+
40
+ alerts: Union[Unset, List[Dict[str, Any]]] = UNSET
41
+ if not isinstance(self.alerts, Unset):
42
+ alerts = []
43
+ for alerts_item_data in self.alerts:
44
+ alerts_item = alerts_item_data.to_dict()
45
+ alerts.append(alerts_item)
46
+
47
+ description = self.description
48
+
49
+ note = self.note
50
+
51
+ registry_url = self.registry_url
52
+
53
+ field_dict: Dict[str, Any] = {}
54
+ field_dict.update(self.additional_properties)
55
+ field_dict.update(
56
+ {
57
+ "ServiceActive": service_active,
58
+ }
59
+ )
60
+ if alerts is not UNSET:
61
+ field_dict["Alerts"] = alerts
62
+ if description is not UNSET:
63
+ field_dict["Description"] = description
64
+ if note is not UNSET:
65
+ field_dict["Note"] = note
66
+ if registry_url is not UNSET:
67
+ field_dict["RegistryURL"] = registry_url
68
+
69
+ return field_dict
70
+
71
+ @classmethod
72
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
73
+ from ..models.sushi_service_status_alerts_item import (
74
+ SUSHIServiceStatusAlertsItem,
75
+ )
76
+
77
+ d = src_dict.copy()
78
+ service_active = d.pop("ServiceActive")
79
+
80
+ alerts = []
81
+ _alerts = d.pop("Alerts", UNSET)
82
+ for alerts_item_data in _alerts or []:
83
+ alerts_item = SUSHIServiceStatusAlertsItem.from_dict(alerts_item_data)
84
+
85
+ alerts.append(alerts_item)
86
+
87
+ description = d.pop("Description", UNSET)
88
+
89
+ note = d.pop("Note", UNSET)
90
+
91
+ registry_url = d.pop("RegistryURL", UNSET)
92
+
93
+ sushi_service_status = cls(
94
+ service_active=service_active,
95
+ alerts=alerts,
96
+ description=description,
97
+ note=note,
98
+ registry_url=registry_url,
99
+ )
100
+
101
+ sushi_service_status.additional_properties = d
102
+ return sushi_service_status
103
+
104
+ @property
105
+ def additional_keys(self) -> List[str]:
106
+ return list(self.additional_properties.keys())
107
+
108
+ def __getitem__(self, key: str) -> Any:
109
+ return self.additional_properties[key]
110
+
111
+ def __setitem__(self, key: str, value: Any) -> None:
112
+ self.additional_properties[key] = value
113
+
114
+ def __delitem__(self, key: str) -> None:
115
+ del self.additional_properties[key]
116
+
117
+ def __contains__(self, key: str) -> bool:
118
+ return key in self.additional_properties
@@ -0,0 +1,43 @@
1
+ from typing import Any, Dict, List, Type, TypeVar
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ T = TypeVar("T", bound="SUSHIServiceStatusAlertsItem")
7
+
8
+
9
+ @_attrs_define
10
+ class SUSHIServiceStatusAlertsItem:
11
+ """ """
12
+
13
+ additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
14
+
15
+ def to_dict(self) -> Dict[str, Any]:
16
+ field_dict: Dict[str, Any] = {}
17
+ field_dict.update(self.additional_properties)
18
+
19
+ return field_dict
20
+
21
+ @classmethod
22
+ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
23
+ d = src_dict.copy()
24
+ sushi_service_status_alerts_item = cls()
25
+
26
+ sushi_service_status_alerts_item.additional_properties = d
27
+ return sushi_service_status_alerts_item
28
+
29
+ @property
30
+ def additional_keys(self) -> List[str]:
31
+ return list(self.additional_properties.keys())
32
+
33
+ def __getitem__(self, key: str) -> Any:
34
+ return self.additional_properties[key]
35
+
36
+ def __setitem__(self, key: str, value: Any) -> None:
37
+ self.additional_properties[key] = value
38
+
39
+ def __delitem__(self, key: str) -> None:
40
+ del self.additional_properties[key]
41
+
42
+ def __contains__(self, key: str) -> bool:
43
+ return key in self.additional_properties
sciencedb/types.py ADDED
@@ -0,0 +1,53 @@
1
+ """Contains some shared types for properties"""
2
+
3
+ from http import HTTPStatus
4
+ from typing import (
5
+ BinaryIO,
6
+ Generic,
7
+ Literal,
8
+ MutableMapping,
9
+ Optional,
10
+ Tuple,
11
+ TypeVar,
12
+ )
13
+
14
+ from attrs import define
15
+
16
+
17
+ class Unset:
18
+ def __bool__(self) -> Literal[False]:
19
+ return False
20
+
21
+
22
+ UNSET: Unset = Unset()
23
+
24
+ FileJsonType = Tuple[Optional[str], BinaryIO, Optional[str]]
25
+
26
+
27
+ @define
28
+ class File:
29
+ """Contains information for file uploads"""
30
+
31
+ payload: BinaryIO
32
+ file_name: Optional[str] = None
33
+ mime_type: Optional[str] = None
34
+
35
+ def to_tuple(self) -> FileJsonType:
36
+ """Return a tuple representation that httpx will accept for multipart/form-data"""
37
+ return self.file_name, self.payload, self.mime_type
38
+
39
+
40
+ T = TypeVar("T")
41
+
42
+
43
+ @define
44
+ class Response(Generic[T]):
45
+ """A response from an endpoint"""
46
+
47
+ status_code: HTTPStatus
48
+ content: bytes
49
+ headers: MutableMapping[str, str]
50
+ parsed: Optional[T]
51
+
52
+
53
+ __all__ = ["File", "Response", "FileJsonType", "Unset", "UNSET"]