snap-python 0.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.
- snap_python/__init__.py +0 -0
- snap_python/client.py +86 -0
- snap_python/components/__init__.py +0 -0
- snap_python/components/snaps.py +92 -0
- snap_python/components/store.py +167 -0
- snap_python/schemas/changes.py +51 -0
- snap_python/schemas/common.py +64 -0
- snap_python/schemas/snaps.py +64 -0
- snap_python/schemas/store/__init__.py +0 -0
- snap_python/schemas/store/categories.py +42 -0
- snap_python/schemas/store/info.py +134 -0
- snap_python/schemas/store/json/category_by_name_schema.json +61 -0
- snap_python/schemas/store/json/category_schema.json +61 -0
- snap_python/schemas/store/json/snaps_find_schema.json +221 -0
- snap_python/schemas/store/json/snaps_info_schema.json +432 -0
- snap_python/schemas/store/search.py +160 -0
- snap_python/utils.py +19 -0
- snap_python-0.0.1.dist-info/LICENSE +21 -0
- snap_python-0.0.1.dist-info/METADATA +39 -0
- snap_python-0.0.1.dist-info/RECORD +21 -0
- snap_python-0.0.1.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# generated by datamodel-codegen:
|
|
2
|
+
# filename: snaps_info_schema.json
|
|
3
|
+
# timestamp: 2024-10-17T01:47:02+00:00
|
|
4
|
+
|
|
5
|
+
from typing import List, Optional
|
|
6
|
+
|
|
7
|
+
from pydantic import AwareDatetime, BaseModel, ConfigDict, Field
|
|
8
|
+
|
|
9
|
+
from snap_python.schemas.store.search import Snap
|
|
10
|
+
|
|
11
|
+
VALID_SNAP_INFO_FIELDS = [
|
|
12
|
+
"architectures",
|
|
13
|
+
"base",
|
|
14
|
+
"categories",
|
|
15
|
+
"channel-map",
|
|
16
|
+
"common-ids",
|
|
17
|
+
"confinement",
|
|
18
|
+
"contact",
|
|
19
|
+
"created-at",
|
|
20
|
+
"description",
|
|
21
|
+
"download",
|
|
22
|
+
"epoch",
|
|
23
|
+
"gated-snap-ids",
|
|
24
|
+
"license",
|
|
25
|
+
"links",
|
|
26
|
+
"media",
|
|
27
|
+
"name",
|
|
28
|
+
"prices",
|
|
29
|
+
"private",
|
|
30
|
+
"publisher",
|
|
31
|
+
"resources",
|
|
32
|
+
"revision",
|
|
33
|
+
"snap-id",
|
|
34
|
+
"snap-yaml",
|
|
35
|
+
"store-url",
|
|
36
|
+
"summary",
|
|
37
|
+
"title",
|
|
38
|
+
"trending",
|
|
39
|
+
"type",
|
|
40
|
+
"unlisted",
|
|
41
|
+
"version",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class Channel(BaseModel):
|
|
46
|
+
model_config = ConfigDict(extra="forbid", exclude_unset=True)
|
|
47
|
+
|
|
48
|
+
architecture: str
|
|
49
|
+
name: str
|
|
50
|
+
released_at: Optional[AwareDatetime] = Field(None, alias="released-at")
|
|
51
|
+
risk: str
|
|
52
|
+
track: str
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class Delta(BaseModel):
|
|
56
|
+
model_config = ConfigDict(extra="forbid", exclude_unset=True)
|
|
57
|
+
|
|
58
|
+
format: str
|
|
59
|
+
sha3_384: str = Field(..., alias="sha3-384")
|
|
60
|
+
size: float
|
|
61
|
+
source: float
|
|
62
|
+
target: float
|
|
63
|
+
url: str
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class Download(BaseModel):
|
|
67
|
+
model_config = ConfigDict(extra="forbid", exclude_unset=True)
|
|
68
|
+
|
|
69
|
+
deltas: List[Delta]
|
|
70
|
+
sha3_384: str = Field(..., alias="sha3-384")
|
|
71
|
+
size: float
|
|
72
|
+
url: str
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class Epoch(BaseModel):
|
|
76
|
+
model_config = ConfigDict(extra="forbid", exclude_unset=True)
|
|
77
|
+
|
|
78
|
+
read: List[float]
|
|
79
|
+
write: List[float]
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
class Download1(BaseModel):
|
|
83
|
+
sha3_384: Optional[str] = Field(None, alias="sha3-384")
|
|
84
|
+
size: Optional[int] = None
|
|
85
|
+
url: Optional[str] = None
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
class Resource(BaseModel):
|
|
89
|
+
model_config = ConfigDict(extra="forbid", exclude_unset=True)
|
|
90
|
+
|
|
91
|
+
architectures: Optional[List[str]] = None
|
|
92
|
+
created_at: Optional[str] = Field(None, alias="created-at")
|
|
93
|
+
description: Optional[str] = None
|
|
94
|
+
download: Optional[Download1] = None
|
|
95
|
+
name: Optional[str] = None
|
|
96
|
+
revision: Optional[int] = None
|
|
97
|
+
type: Optional[str] = None
|
|
98
|
+
version: Optional[str] = None
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
class ChannelMapItem(BaseModel):
|
|
102
|
+
model_config = ConfigDict(extra="forbid", exclude_unset=True)
|
|
103
|
+
|
|
104
|
+
architectures: Optional[List[str]] = None
|
|
105
|
+
base: Optional[str] = None
|
|
106
|
+
channel: Channel
|
|
107
|
+
common_ids: Optional[List[str]] = Field(None, alias="common-ids")
|
|
108
|
+
confinement: Optional[str] = None
|
|
109
|
+
created_at: Optional[AwareDatetime] = Field(None, alias="created-at")
|
|
110
|
+
download: Optional[Download] = None
|
|
111
|
+
epoch: Optional[Epoch] = None
|
|
112
|
+
resources: Optional[List[Resource]] = None
|
|
113
|
+
revision: Optional[int] = None
|
|
114
|
+
snap_yaml: Optional[str] = Field(None, alias="snap-yaml")
|
|
115
|
+
type: Optional[str] = None
|
|
116
|
+
version: Optional[str] = None
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
class ErrorListItem(BaseModel):
|
|
120
|
+
model_config = ConfigDict(extra="forbid", exclude_unset=True)
|
|
121
|
+
|
|
122
|
+
code: str
|
|
123
|
+
message: str
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
class InfoResponse(BaseModel):
|
|
127
|
+
model_config = ConfigDict(extra="forbid", exclude_unset=True)
|
|
128
|
+
|
|
129
|
+
channel_map: List[ChannelMapItem] = Field(..., alias="channel-map")
|
|
130
|
+
default_track: Optional[str] = Field(None, alias="default-track")
|
|
131
|
+
error_list: Optional[List[ErrorListItem]] = Field(None, alias="error-list")
|
|
132
|
+
name: str
|
|
133
|
+
snap: Snap
|
|
134
|
+
snap_id: str = Field(..., alias="snap-id")
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"additionalProperties": false,
|
|
3
|
+
"properties": {
|
|
4
|
+
"category": {
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"properties": {
|
|
7
|
+
"description": {
|
|
8
|
+
"type": [
|
|
9
|
+
"string",
|
|
10
|
+
"null"
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
"media": {
|
|
14
|
+
"additionalProperties": false,
|
|
15
|
+
"properties": {
|
|
16
|
+
"height": {
|
|
17
|
+
"type": "number"
|
|
18
|
+
},
|
|
19
|
+
"type": {
|
|
20
|
+
"type": "string"
|
|
21
|
+
},
|
|
22
|
+
"url": {
|
|
23
|
+
"type": "string"
|
|
24
|
+
},
|
|
25
|
+
"width": {
|
|
26
|
+
"type": "number"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"required": [
|
|
30
|
+
"type",
|
|
31
|
+
"url"
|
|
32
|
+
],
|
|
33
|
+
"type": "object"
|
|
34
|
+
},
|
|
35
|
+
"name": {
|
|
36
|
+
"type": "string"
|
|
37
|
+
},
|
|
38
|
+
"summary": {
|
|
39
|
+
"type": [
|
|
40
|
+
"string",
|
|
41
|
+
"null"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"title": {
|
|
45
|
+
"type": [
|
|
46
|
+
"string",
|
|
47
|
+
"null"
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
"type": {
|
|
51
|
+
"type": "string"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"type": "object"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"required": [
|
|
58
|
+
"category"
|
|
59
|
+
],
|
|
60
|
+
"type": "object"
|
|
61
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"additionalProperties": false,
|
|
3
|
+
"properties": {
|
|
4
|
+
"categories": {
|
|
5
|
+
"items": {
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"description": {
|
|
9
|
+
"type": [
|
|
10
|
+
"string",
|
|
11
|
+
"null"
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
"media": {
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"properties": {
|
|
17
|
+
"height": {
|
|
18
|
+
"type": "number"
|
|
19
|
+
},
|
|
20
|
+
"type": {
|
|
21
|
+
"type": "string"
|
|
22
|
+
},
|
|
23
|
+
"url": {
|
|
24
|
+
"type": "string"
|
|
25
|
+
},
|
|
26
|
+
"width": {
|
|
27
|
+
"type": "number"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"required": [
|
|
31
|
+
"type",
|
|
32
|
+
"url"
|
|
33
|
+
],
|
|
34
|
+
"type": "object"
|
|
35
|
+
},
|
|
36
|
+
"name": {
|
|
37
|
+
"type": "string"
|
|
38
|
+
},
|
|
39
|
+
"summary": {
|
|
40
|
+
"type": [
|
|
41
|
+
"string",
|
|
42
|
+
"null"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
"title": {
|
|
46
|
+
"type": [
|
|
47
|
+
"string",
|
|
48
|
+
"null"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"type": {
|
|
52
|
+
"type": "string"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"type": "object"
|
|
56
|
+
},
|
|
57
|
+
"type": "array"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"type": "object"
|
|
61
|
+
}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
{
|
|
2
|
+
"additionalProperties": false,
|
|
3
|
+
"properties": {
|
|
4
|
+
"error-list": {
|
|
5
|
+
"items": {
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"code": {
|
|
9
|
+
"type": "string"
|
|
10
|
+
},
|
|
11
|
+
"message": {
|
|
12
|
+
"type": "string"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"required": [
|
|
16
|
+
"code",
|
|
17
|
+
"message"
|
|
18
|
+
],
|
|
19
|
+
"type": "object"
|
|
20
|
+
},
|
|
21
|
+
"type": "array"
|
|
22
|
+
},
|
|
23
|
+
"results": {
|
|
24
|
+
"items": {
|
|
25
|
+
"additionalProperties": false,
|
|
26
|
+
"properties": {
|
|
27
|
+
"name": {
|
|
28
|
+
"type": "string"
|
|
29
|
+
},
|
|
30
|
+
"revision": {
|
|
31
|
+
"additionalProperties": false,
|
|
32
|
+
"properties": {
|
|
33
|
+
"base": {
|
|
34
|
+
"type": [
|
|
35
|
+
"string",
|
|
36
|
+
"null"
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"channel": {
|
|
40
|
+
"type": "string"
|
|
41
|
+
},
|
|
42
|
+
"common-ids": {
|
|
43
|
+
"introduced_at": 20,
|
|
44
|
+
"items": {
|
|
45
|
+
"type": "string"
|
|
46
|
+
},
|
|
47
|
+
"type": "array"
|
|
48
|
+
},
|
|
49
|
+
"confinement": {
|
|
50
|
+
"type": "string"
|
|
51
|
+
},
|
|
52
|
+
"download": {
|
|
53
|
+
"additionalProperties": false,
|
|
54
|
+
"properties": {
|
|
55
|
+
"size": {
|
|
56
|
+
"type": "number"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"required": [
|
|
60
|
+
"size"
|
|
61
|
+
],
|
|
62
|
+
"type": "object"
|
|
63
|
+
},
|
|
64
|
+
"revision": {
|
|
65
|
+
"type": "number"
|
|
66
|
+
},
|
|
67
|
+
"type": {
|
|
68
|
+
"type": "string"
|
|
69
|
+
},
|
|
70
|
+
"version": {
|
|
71
|
+
"type": "string"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"type": "object"
|
|
75
|
+
},
|
|
76
|
+
"snap": {
|
|
77
|
+
"additionalProperties": false,
|
|
78
|
+
"properties": {
|
|
79
|
+
"categories": {
|
|
80
|
+
"items": {
|
|
81
|
+
"additionalProperties": false,
|
|
82
|
+
"properties": {
|
|
83
|
+
"featured": {
|
|
84
|
+
"type": "boolean"
|
|
85
|
+
},
|
|
86
|
+
"name": {
|
|
87
|
+
"type": "string"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"required": [
|
|
91
|
+
"name",
|
|
92
|
+
"featured"
|
|
93
|
+
],
|
|
94
|
+
"type": "object"
|
|
95
|
+
},
|
|
96
|
+
"type": "array"
|
|
97
|
+
},
|
|
98
|
+
"contact": {
|
|
99
|
+
"type": "string"
|
|
100
|
+
},
|
|
101
|
+
"description": {
|
|
102
|
+
"type": "string"
|
|
103
|
+
},
|
|
104
|
+
"license": {
|
|
105
|
+
"type": "string"
|
|
106
|
+
},
|
|
107
|
+
"links": {
|
|
108
|
+
"additionalProperties": {
|
|
109
|
+
"items": {
|
|
110
|
+
"type": "string"
|
|
111
|
+
},
|
|
112
|
+
"minItems": 1,
|
|
113
|
+
"type": "array"
|
|
114
|
+
},
|
|
115
|
+
"introduced_at": 21,
|
|
116
|
+
"type": [
|
|
117
|
+
"object",
|
|
118
|
+
"null"
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
"media": {
|
|
122
|
+
"items": {
|
|
123
|
+
"additionalProperties": false,
|
|
124
|
+
"properties": {
|
|
125
|
+
"height": {
|
|
126
|
+
"type": [
|
|
127
|
+
"null",
|
|
128
|
+
"integer"
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
"type": {
|
|
132
|
+
"type": "string"
|
|
133
|
+
},
|
|
134
|
+
"url": {
|
|
135
|
+
"type": "string"
|
|
136
|
+
},
|
|
137
|
+
"width": {
|
|
138
|
+
"type": [
|
|
139
|
+
"null",
|
|
140
|
+
"integer"
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
"required": [
|
|
145
|
+
"type",
|
|
146
|
+
"url",
|
|
147
|
+
"width",
|
|
148
|
+
"height"
|
|
149
|
+
],
|
|
150
|
+
"type": "object"
|
|
151
|
+
},
|
|
152
|
+
"type": "array"
|
|
153
|
+
},
|
|
154
|
+
"prices": {
|
|
155
|
+
"type": "object"
|
|
156
|
+
},
|
|
157
|
+
"private": {
|
|
158
|
+
"type": "boolean"
|
|
159
|
+
},
|
|
160
|
+
"publisher": {
|
|
161
|
+
"additionalProperties": false,
|
|
162
|
+
"properties": {
|
|
163
|
+
"display-name": {
|
|
164
|
+
"type": "string"
|
|
165
|
+
},
|
|
166
|
+
"id": {
|
|
167
|
+
"type": "string"
|
|
168
|
+
},
|
|
169
|
+
"username": {
|
|
170
|
+
"type": "string"
|
|
171
|
+
},
|
|
172
|
+
"validation": {
|
|
173
|
+
"type": "string"
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"required": [
|
|
177
|
+
"id",
|
|
178
|
+
"username",
|
|
179
|
+
"display-name"
|
|
180
|
+
],
|
|
181
|
+
"type": "object"
|
|
182
|
+
},
|
|
183
|
+
"store-url": {
|
|
184
|
+
"introduced_at": 20,
|
|
185
|
+
"type": "string"
|
|
186
|
+
},
|
|
187
|
+
"summary": {
|
|
188
|
+
"type": "string"
|
|
189
|
+
},
|
|
190
|
+
"title": {
|
|
191
|
+
"type": "string"
|
|
192
|
+
},
|
|
193
|
+
"website": {
|
|
194
|
+
"introduced_at": 20,
|
|
195
|
+
"type": [
|
|
196
|
+
"null",
|
|
197
|
+
"string"
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
"type": "object"
|
|
202
|
+
},
|
|
203
|
+
"snap-id": {
|
|
204
|
+
"type": "string"
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"required": [
|
|
208
|
+
"name",
|
|
209
|
+
"snap-id",
|
|
210
|
+
"snap"
|
|
211
|
+
],
|
|
212
|
+
"type": "object"
|
|
213
|
+
},
|
|
214
|
+
"type": "array"
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
"required": [
|
|
218
|
+
"results"
|
|
219
|
+
],
|
|
220
|
+
"type": "object"
|
|
221
|
+
}
|