carbonarc 1.0.0__tar.gz → 1.0.1__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: carbonarc
3
- Version: 1.0.0
3
+ Version: 1.0.1
4
4
  Summary: Carbon Arc - Python Package
5
5
  License: MIT
6
6
  Author: Carbon Arc
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "carbonarc"
3
- version = "1.0.0"
3
+ version = "1.0.1"
4
4
  description = "Carbon Arc - Python Package"
5
5
  authors = ["Carbon Arc <support@carbonarc.co>"]
6
6
  readme = "README.md"
@@ -13,7 +13,7 @@ class BaseAPIClient:
13
13
  def __init__(
14
14
  self,
15
15
  token: str,
16
- host: str = "https://platform.carbonarc.co",
16
+ host: str = "https://api.carbonarc.co",
17
17
  version: str = "v2"
18
18
  ):
19
19
  """
@@ -35,7 +35,12 @@ class BaseAPIClient:
35
35
  self,
36
36
  product: Literal["clients", "framework", "library", "ontology", "hub"],
37
37
  ) -> str:
38
- return self.host + f"/api/{self.version}/" + product
38
+
39
+ url = self.host + f"/{self.version}/" + product
40
+
41
+ url = url.replace("//", "/")
42
+
43
+ return url
39
44
 
40
45
  def _get(self, url: str, **kwargs) -> dict:
41
46
  return self.request_manager.get(url, **kwargs).json()
@@ -93,7 +93,7 @@ class ExplorerAPIClient(BaseAPIClient):
93
93
  """
94
94
  self._validate_framework(framework)
95
95
  url = f"{self.base_framework_url}/filters"
96
- return self._post(url, json=framework)
96
+ return self._post(url, json={"framework": framework})
97
97
 
98
98
  def collect_framework_filter_options(self, framework: dict, filter_key: str) -> dict:
99
99
  """
@@ -108,7 +108,7 @@ class ExplorerAPIClient(BaseAPIClient):
108
108
  """
109
109
  self._validate_framework(framework)
110
110
  url = f"{self.base_framework_url}/filters/{filter_key}/options"
111
- return self._post(url, json=framework)
111
+ return self._post(url, json={"framework": framework})
112
112
 
113
113
 
114
114
  def collect_framework_information(self, framework: dict) -> dict:
@@ -123,7 +123,7 @@ class ExplorerAPIClient(BaseAPIClient):
123
123
  """
124
124
  self._validate_framework(framework)
125
125
  url = f"{self.base_framework_url}/information"
126
- return self._post(url, json=framework)
126
+ return self._post(url, json={"framework": framework})
127
127
 
128
128
  def buy_frameworks(self, order: List[dict]) -> dict:
129
129
  """
@@ -138,7 +138,7 @@ class ExplorerAPIClient(BaseAPIClient):
138
138
  for framework in order:
139
139
  self._validate_framework(framework)
140
140
  url = f"{self.base_framework_url}/buy"
141
- return self._post(url, json=order)
141
+ return self._post(url, json={"order": {"frameworks": order}})
142
142
 
143
143
  def get_framework_data(
144
144
  self,
File without changes
File without changes