canonicalwebteam.store-api 4.7.1__py3-none-any.whl → 4.8.0__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.
- canonicalwebteam/store_api/store.py +0 -35
- canonicalwebteam/store_api/stores/charmstore.py +35 -0
- canonicalwebteam/store_api/stores/snapstore.py +23 -0
- {canonicalwebteam_store_api-4.7.1.dist-info → canonicalwebteam_store_api-4.8.0.dist-info}/METADATA +1 -1
- canonicalwebteam_store_api-4.8.0.dist-info/RECORD +12 -0
- canonicalwebteam_store_api-4.7.1.dist-info/RECORD +0 -12
- {canonicalwebteam_store_api-4.7.1.dist-info → canonicalwebteam_store_api-4.8.0.dist-info}/LICENSE +0 -0
- {canonicalwebteam_store_api-4.7.1.dist-info → canonicalwebteam_store_api-4.8.0.dist-info}/WHEEL +0 -0
|
@@ -57,41 +57,6 @@ class Store:
|
|
|
57
57
|
base_url = self.config[api_version]["base_url"]
|
|
58
58
|
return f"{base_url}{endpoint}"
|
|
59
59
|
|
|
60
|
-
def find(
|
|
61
|
-
self,
|
|
62
|
-
query="",
|
|
63
|
-
category="",
|
|
64
|
-
publisher="",
|
|
65
|
-
provides=[],
|
|
66
|
-
requires=[],
|
|
67
|
-
fields=[],
|
|
68
|
-
):
|
|
69
|
-
"""
|
|
70
|
-
Given a search term, return an array of matching search results.
|
|
71
|
-
v2 API only.
|
|
72
|
-
"""
|
|
73
|
-
url = self.get_endpoint_url("find", 2)
|
|
74
|
-
headers = self.config[2].get("headers")
|
|
75
|
-
|
|
76
|
-
params = {
|
|
77
|
-
"q": query,
|
|
78
|
-
"category": category,
|
|
79
|
-
"publisher": publisher,
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if fields:
|
|
83
|
-
params["fields"] = ",".join(fields)
|
|
84
|
-
|
|
85
|
-
if provides:
|
|
86
|
-
params["provides"] = ",".join(provides)
|
|
87
|
-
|
|
88
|
-
if requires:
|
|
89
|
-
params["requires"] = ",".join(requires)
|
|
90
|
-
|
|
91
|
-
return self.process_response(
|
|
92
|
-
self.session.get(url, params=params, headers=headers)
|
|
93
|
-
)
|
|
94
|
-
|
|
95
60
|
def search(
|
|
96
61
|
self,
|
|
97
62
|
search,
|
|
@@ -20,6 +20,41 @@ class CharmStore(Store):
|
|
|
20
20
|
2: {"base_url": f"{CHARMSTORE_API_URL}v2/charms/"},
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
def find(
|
|
24
|
+
self,
|
|
25
|
+
query="",
|
|
26
|
+
category="",
|
|
27
|
+
publisher="",
|
|
28
|
+
type=None,
|
|
29
|
+
provides=[],
|
|
30
|
+
requires=[],
|
|
31
|
+
fields=[],
|
|
32
|
+
):
|
|
33
|
+
"""
|
|
34
|
+
Given a search term, return an array of matching search results.
|
|
35
|
+
v2 API only.
|
|
36
|
+
"""
|
|
37
|
+
url = self.get_endpoint_url("find", 2)
|
|
38
|
+
headers = self.config[2].get("headers")
|
|
39
|
+
params = {
|
|
40
|
+
"q": query,
|
|
41
|
+
"category": category,
|
|
42
|
+
"publisher": publisher,
|
|
43
|
+
"type": type,
|
|
44
|
+
}
|
|
45
|
+
if fields:
|
|
46
|
+
params["fields"] = ",".join(fields)
|
|
47
|
+
|
|
48
|
+
if provides:
|
|
49
|
+
params["provides"] = ",".join(provides)
|
|
50
|
+
|
|
51
|
+
if requires:
|
|
52
|
+
params["requires"] = ",".join(requires)
|
|
53
|
+
|
|
54
|
+
return self.process_response(
|
|
55
|
+
self.session.get(url, params=params, headers=headers)
|
|
56
|
+
)
|
|
57
|
+
|
|
23
58
|
|
|
24
59
|
class CharmPublisher(Publisher):
|
|
25
60
|
def __init__(self, session=requests.Session()):
|
|
@@ -60,6 +60,29 @@ class SnapStore(Store):
|
|
|
60
60
|
name, None, fields, api_version
|
|
61
61
|
)
|
|
62
62
|
|
|
63
|
+
def find(
|
|
64
|
+
self,
|
|
65
|
+
query="",
|
|
66
|
+
category="",
|
|
67
|
+
architecture="",
|
|
68
|
+
publisher="",
|
|
69
|
+
featured="false",
|
|
70
|
+
fields=[],
|
|
71
|
+
):
|
|
72
|
+
url = self.get_endpoint_url("find", 2)
|
|
73
|
+
headers = self.config[2].get("headers")
|
|
74
|
+
params = {
|
|
75
|
+
"q": query,
|
|
76
|
+
"category": category,
|
|
77
|
+
"architecture": architecture,
|
|
78
|
+
"publisher": publisher,
|
|
79
|
+
"featured": featured,
|
|
80
|
+
}
|
|
81
|
+
if fields:
|
|
82
|
+
params["fields"] = ",".join(fields)
|
|
83
|
+
response = self.session.get(url, params=params, headers=headers)
|
|
84
|
+
return self.process_response(response)
|
|
85
|
+
|
|
63
86
|
|
|
64
87
|
class SnapPublisher(Publisher):
|
|
65
88
|
def __init__(self, session=requests.Session()):
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
canonicalwebteam/__init__.py,sha256=ED6jHcYiuYpr_0vjGz0zx2lrrmJT9sDJCzIljoDfmlM,65
|
|
2
|
+
canonicalwebteam/store_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
canonicalwebteam/store_api/exceptions.py,sha256=A49LRhiEIfXNB2zC-zNcZEcdh0ugw6G7fBbXbs-BWxA,1517
|
|
4
|
+
canonicalwebteam/store_api/publisher.py,sha256=c3zvfp8tbplsju5MLb2Zc5uCldj8fiHcbX1ZD0o9Cfo,10632
|
|
5
|
+
canonicalwebteam/store_api/store.py,sha256=dyz3afMF_mTr3k6oAx5pBU0U8zRLIFYYgO-BUa62mj4,6249
|
|
6
|
+
canonicalwebteam/store_api/stores/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
canonicalwebteam/store_api/stores/charmstore.py,sha256=m-Ug3LLOkcKeg2i5J_Gi2Z0De1OPl1xT2_e7z8oNtdY,11602
|
|
8
|
+
canonicalwebteam/store_api/stores/snapstore.py,sha256=WQ8PgwrnLAq3MSlNklNDXqPAZy3PCHVoiF55kEKKOoo,14824
|
|
9
|
+
canonicalwebteam_store_api-4.8.0.dist-info/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
|
|
10
|
+
canonicalwebteam_store_api-4.8.0.dist-info/METADATA,sha256=SnIp2PqLM9QQR-l7qWHhn-ucN6uoamq34ECK4zMU6KI,2264
|
|
11
|
+
canonicalwebteam_store_api-4.8.0.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
12
|
+
canonicalwebteam_store_api-4.8.0.dist-info/RECORD,,
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
canonicalwebteam/__init__.py,sha256=ED6jHcYiuYpr_0vjGz0zx2lrrmJT9sDJCzIljoDfmlM,65
|
|
2
|
-
canonicalwebteam/store_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
canonicalwebteam/store_api/exceptions.py,sha256=A49LRhiEIfXNB2zC-zNcZEcdh0ugw6G7fBbXbs-BWxA,1517
|
|
4
|
-
canonicalwebteam/store_api/publisher.py,sha256=c3zvfp8tbplsju5MLb2Zc5uCldj8fiHcbX1ZD0o9Cfo,10632
|
|
5
|
-
canonicalwebteam/store_api/store.py,sha256=pUJtz9CfF4KZtabmCmkq5PKWdLWy8X-QiY27yx2Av5U,7075
|
|
6
|
-
canonicalwebteam/store_api/stores/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
-
canonicalwebteam/store_api/stores/charmstore.py,sha256=WpFLB-QTETWlW3Npp1X52HIAZuu0u3ftXcSorrE2hJ0,10733
|
|
8
|
-
canonicalwebteam/store_api/stores/snapstore.py,sha256=MYoTdnMZDYkTMnX6P5lGsVHAXFGbQBcYbLZkebNDiqs,14176
|
|
9
|
-
canonicalwebteam_store_api-4.7.1.dist-info/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
|
|
10
|
-
canonicalwebteam_store_api-4.7.1.dist-info/METADATA,sha256=PO3kT3Jnuuu1pZL0iagpc8Gp4uMNcu89WIyrddsL6Xk,2264
|
|
11
|
-
canonicalwebteam_store_api-4.7.1.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
12
|
-
canonicalwebteam_store_api-4.7.1.dist-info/RECORD,,
|
{canonicalwebteam_store_api-4.7.1.dist-info → canonicalwebteam_store_api-4.8.0.dist-info}/LICENSE
RENAMED
|
File without changes
|
{canonicalwebteam_store_api-4.7.1.dist-info → canonicalwebteam_store_api-4.8.0.dist-info}/WHEEL
RENAMED
|
File without changes
|