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,432 @@
|
|
|
1
|
+
{
|
|
2
|
+
"additionalProperties": false,
|
|
3
|
+
"properties": {
|
|
4
|
+
"channel-map": {
|
|
5
|
+
"items": {
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"architectures": {
|
|
9
|
+
"items": {
|
|
10
|
+
"type": "string"
|
|
11
|
+
},
|
|
12
|
+
"type": "array"
|
|
13
|
+
},
|
|
14
|
+
"base": {
|
|
15
|
+
"oneOf": [
|
|
16
|
+
{
|
|
17
|
+
"type": "null"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"type": "string"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"channel": {
|
|
25
|
+
"additionalProperties": false,
|
|
26
|
+
"properties": {
|
|
27
|
+
"architecture": {
|
|
28
|
+
"type": "string"
|
|
29
|
+
},
|
|
30
|
+
"name": {
|
|
31
|
+
"type": "string"
|
|
32
|
+
},
|
|
33
|
+
"released-at": {
|
|
34
|
+
"introduced_at": 5,
|
|
35
|
+
"type": [
|
|
36
|
+
"string",
|
|
37
|
+
"null"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
"risk": {
|
|
41
|
+
"type": "string"
|
|
42
|
+
},
|
|
43
|
+
"track": {
|
|
44
|
+
"type": "string"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"required": [
|
|
48
|
+
"track",
|
|
49
|
+
"risk",
|
|
50
|
+
"name",
|
|
51
|
+
"architecture"
|
|
52
|
+
],
|
|
53
|
+
"type": "object"
|
|
54
|
+
},
|
|
55
|
+
"common-ids": {
|
|
56
|
+
"items": {
|
|
57
|
+
"type": "string"
|
|
58
|
+
},
|
|
59
|
+
"type": "array"
|
|
60
|
+
},
|
|
61
|
+
"confinement": {
|
|
62
|
+
"type": "string"
|
|
63
|
+
},
|
|
64
|
+
"created-at": {
|
|
65
|
+
"type": "string"
|
|
66
|
+
},
|
|
67
|
+
"download": {
|
|
68
|
+
"additionalProperties": false,
|
|
69
|
+
"properties": {
|
|
70
|
+
"deltas": {
|
|
71
|
+
"items": {
|
|
72
|
+
"additionalProperties": false,
|
|
73
|
+
"properties": {
|
|
74
|
+
"format": {
|
|
75
|
+
"type": "string"
|
|
76
|
+
},
|
|
77
|
+
"sha3-384": {
|
|
78
|
+
"type": "string"
|
|
79
|
+
},
|
|
80
|
+
"size": {
|
|
81
|
+
"type": "number"
|
|
82
|
+
},
|
|
83
|
+
"source": {
|
|
84
|
+
"type": "number"
|
|
85
|
+
},
|
|
86
|
+
"target": {
|
|
87
|
+
"type": "number"
|
|
88
|
+
},
|
|
89
|
+
"url": {
|
|
90
|
+
"type": "string"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"required": [
|
|
94
|
+
"format",
|
|
95
|
+
"sha3-384",
|
|
96
|
+
"size",
|
|
97
|
+
"source",
|
|
98
|
+
"target",
|
|
99
|
+
"url"
|
|
100
|
+
],
|
|
101
|
+
"type": "object"
|
|
102
|
+
},
|
|
103
|
+
"type": "array"
|
|
104
|
+
},
|
|
105
|
+
"sha3-384": {
|
|
106
|
+
"type": "string"
|
|
107
|
+
},
|
|
108
|
+
"size": {
|
|
109
|
+
"type": "number"
|
|
110
|
+
},
|
|
111
|
+
"url": {
|
|
112
|
+
"type": "string"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"required": [
|
|
116
|
+
"sha3-384",
|
|
117
|
+
"size",
|
|
118
|
+
"url",
|
|
119
|
+
"deltas"
|
|
120
|
+
],
|
|
121
|
+
"type": "object"
|
|
122
|
+
},
|
|
123
|
+
"epoch": {
|
|
124
|
+
"additionalProperties": false,
|
|
125
|
+
"properties": {
|
|
126
|
+
"read": {
|
|
127
|
+
"items": {
|
|
128
|
+
"type": "number"
|
|
129
|
+
},
|
|
130
|
+
"type": "array"
|
|
131
|
+
},
|
|
132
|
+
"write": {
|
|
133
|
+
"items": {
|
|
134
|
+
"type": "number"
|
|
135
|
+
},
|
|
136
|
+
"type": "array"
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"required": [
|
|
140
|
+
"read",
|
|
141
|
+
"write"
|
|
142
|
+
],
|
|
143
|
+
"type": [
|
|
144
|
+
"object",
|
|
145
|
+
"null"
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
"resources": {
|
|
149
|
+
"introduced_at": 57,
|
|
150
|
+
"items": {
|
|
151
|
+
"additionalProperties": false,
|
|
152
|
+
"introduced_at": 57,
|
|
153
|
+
"properties": {
|
|
154
|
+
"architectures": {
|
|
155
|
+
"introduced_at": 59,
|
|
156
|
+
"items": {
|
|
157
|
+
"introduced_at": 59,
|
|
158
|
+
"type": "string"
|
|
159
|
+
},
|
|
160
|
+
"type": "array"
|
|
161
|
+
},
|
|
162
|
+
"created-at": {
|
|
163
|
+
"introduced_at": 57,
|
|
164
|
+
"type": "string"
|
|
165
|
+
},
|
|
166
|
+
"description": {
|
|
167
|
+
"introduced_at": 57,
|
|
168
|
+
"type": "string"
|
|
169
|
+
},
|
|
170
|
+
"download": {
|
|
171
|
+
"introduced_at": 57,
|
|
172
|
+
"properties": {
|
|
173
|
+
"sha3-384": {
|
|
174
|
+
"introduced_at": 57,
|
|
175
|
+
"type": "string"
|
|
176
|
+
},
|
|
177
|
+
"size": {
|
|
178
|
+
"introduced_at": 57,
|
|
179
|
+
"type": "integer"
|
|
180
|
+
},
|
|
181
|
+
"url": {
|
|
182
|
+
"introduced_at": 57,
|
|
183
|
+
"type": "string"
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
"type": "object"
|
|
187
|
+
},
|
|
188
|
+
"name": {
|
|
189
|
+
"introduced_at": 57,
|
|
190
|
+
"type": "string"
|
|
191
|
+
},
|
|
192
|
+
"revision": {
|
|
193
|
+
"introduced_at": 57,
|
|
194
|
+
"type": "integer"
|
|
195
|
+
},
|
|
196
|
+
"type": {
|
|
197
|
+
"introduced_at": 57,
|
|
198
|
+
"type": "string"
|
|
199
|
+
},
|
|
200
|
+
"version": {
|
|
201
|
+
"introduced_at": 57,
|
|
202
|
+
"type": [
|
|
203
|
+
"null",
|
|
204
|
+
"string"
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
"type": "object"
|
|
209
|
+
},
|
|
210
|
+
"type": "array"
|
|
211
|
+
},
|
|
212
|
+
"revision": {
|
|
213
|
+
"type": "number"
|
|
214
|
+
},
|
|
215
|
+
"snap-yaml": {
|
|
216
|
+
"type": "string"
|
|
217
|
+
},
|
|
218
|
+
"type": {
|
|
219
|
+
"type": "string"
|
|
220
|
+
},
|
|
221
|
+
"version": {
|
|
222
|
+
"type": "string"
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
"required": [
|
|
226
|
+
"channel"
|
|
227
|
+
],
|
|
228
|
+
"type": "object"
|
|
229
|
+
},
|
|
230
|
+
"type": "array"
|
|
231
|
+
},
|
|
232
|
+
"default-track": {
|
|
233
|
+
"introduced_at": 14,
|
|
234
|
+
"type": [
|
|
235
|
+
"string",
|
|
236
|
+
"null"
|
|
237
|
+
]
|
|
238
|
+
},
|
|
239
|
+
"error-list": {
|
|
240
|
+
"items": {
|
|
241
|
+
"additionalProperties": false,
|
|
242
|
+
"properties": {
|
|
243
|
+
"code": {
|
|
244
|
+
"type": "string"
|
|
245
|
+
},
|
|
246
|
+
"message": {
|
|
247
|
+
"type": "string"
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
"required": [
|
|
251
|
+
"code",
|
|
252
|
+
"message"
|
|
253
|
+
],
|
|
254
|
+
"type": "object"
|
|
255
|
+
},
|
|
256
|
+
"type": "array"
|
|
257
|
+
},
|
|
258
|
+
"name": {
|
|
259
|
+
"type": "string"
|
|
260
|
+
},
|
|
261
|
+
"snap": {
|
|
262
|
+
"additionalProperties": false,
|
|
263
|
+
"properties": {
|
|
264
|
+
"categories": {
|
|
265
|
+
"introduced_at": 11,
|
|
266
|
+
"items": {
|
|
267
|
+
"additionalProperties": false,
|
|
268
|
+
"properties": {
|
|
269
|
+
"featured": {
|
|
270
|
+
"introduced_at": 11,
|
|
271
|
+
"type": "boolean"
|
|
272
|
+
},
|
|
273
|
+
"name": {
|
|
274
|
+
"introduced_at": 11,
|
|
275
|
+
"type": "string"
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
"required": [
|
|
279
|
+
"name",
|
|
280
|
+
"featured"
|
|
281
|
+
],
|
|
282
|
+
"type": "object"
|
|
283
|
+
},
|
|
284
|
+
"type": "array"
|
|
285
|
+
},
|
|
286
|
+
"contact": {
|
|
287
|
+
"type": "string"
|
|
288
|
+
},
|
|
289
|
+
"description": {
|
|
290
|
+
"type": "string"
|
|
291
|
+
},
|
|
292
|
+
"gated-snap-ids": {
|
|
293
|
+
"items": {
|
|
294
|
+
"type": "string"
|
|
295
|
+
},
|
|
296
|
+
"type": "array"
|
|
297
|
+
},
|
|
298
|
+
"license": {
|
|
299
|
+
"type": "string"
|
|
300
|
+
},
|
|
301
|
+
"links": {
|
|
302
|
+
"additionalProperties": {
|
|
303
|
+
"items": {
|
|
304
|
+
"type": "string"
|
|
305
|
+
},
|
|
306
|
+
"minItems": 1,
|
|
307
|
+
"type": "array"
|
|
308
|
+
},
|
|
309
|
+
"introduced_at": 21,
|
|
310
|
+
"type": [
|
|
311
|
+
"object",
|
|
312
|
+
"null"
|
|
313
|
+
]
|
|
314
|
+
},
|
|
315
|
+
"media": {
|
|
316
|
+
"items": {
|
|
317
|
+
"additionalProperties": false,
|
|
318
|
+
"properties": {
|
|
319
|
+
"height": {
|
|
320
|
+
"type": [
|
|
321
|
+
"null",
|
|
322
|
+
"integer"
|
|
323
|
+
]
|
|
324
|
+
},
|
|
325
|
+
"type": {
|
|
326
|
+
"type": "string"
|
|
327
|
+
},
|
|
328
|
+
"url": {
|
|
329
|
+
"type": "string"
|
|
330
|
+
},
|
|
331
|
+
"width": {
|
|
332
|
+
"type": [
|
|
333
|
+
"null",
|
|
334
|
+
"integer"
|
|
335
|
+
]
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
"required": [
|
|
339
|
+
"type",
|
|
340
|
+
"url",
|
|
341
|
+
"width",
|
|
342
|
+
"height"
|
|
343
|
+
],
|
|
344
|
+
"type": "object"
|
|
345
|
+
},
|
|
346
|
+
"type": "array"
|
|
347
|
+
},
|
|
348
|
+
"name": {
|
|
349
|
+
"type": "string"
|
|
350
|
+
},
|
|
351
|
+
"prices": {
|
|
352
|
+
"type": "object"
|
|
353
|
+
},
|
|
354
|
+
"private": {
|
|
355
|
+
"type": "boolean"
|
|
356
|
+
},
|
|
357
|
+
"publisher": {
|
|
358
|
+
"additionalProperties": false,
|
|
359
|
+
"description": "The publisher.",
|
|
360
|
+
"properties": {
|
|
361
|
+
"display-name": {
|
|
362
|
+
"description": "Display name corresponding to the publisher.",
|
|
363
|
+
"type": "string"
|
|
364
|
+
},
|
|
365
|
+
"id": {
|
|
366
|
+
"description": "The publisher id.",
|
|
367
|
+
"type": "string"
|
|
368
|
+
},
|
|
369
|
+
"username": {
|
|
370
|
+
"description": "Username belonging to the publisher.",
|
|
371
|
+
"type": "string"
|
|
372
|
+
},
|
|
373
|
+
"validation": {
|
|
374
|
+
"description": "Indicates if the account has been validated.",
|
|
375
|
+
"introduced_at": 3,
|
|
376
|
+
"type": "string"
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
"required": [
|
|
380
|
+
"id",
|
|
381
|
+
"username",
|
|
382
|
+
"display-name"
|
|
383
|
+
],
|
|
384
|
+
"type": "object"
|
|
385
|
+
},
|
|
386
|
+
"snap-id": {
|
|
387
|
+
"type": "string"
|
|
388
|
+
},
|
|
389
|
+
"store-url": {
|
|
390
|
+
"introduced_at": 17,
|
|
391
|
+
"type": "string"
|
|
392
|
+
},
|
|
393
|
+
"summary": {
|
|
394
|
+
"type": "string"
|
|
395
|
+
},
|
|
396
|
+
"title": {
|
|
397
|
+
"type": "string"
|
|
398
|
+
},
|
|
399
|
+
"trending": {
|
|
400
|
+
"introduced_at": 16,
|
|
401
|
+
"type": "boolean"
|
|
402
|
+
},
|
|
403
|
+
"unlisted": {
|
|
404
|
+
"introduced_at": 18,
|
|
405
|
+
"type": "boolean"
|
|
406
|
+
},
|
|
407
|
+
"website": {
|
|
408
|
+
"introduced_at": 4,
|
|
409
|
+
"oneOf": [
|
|
410
|
+
{
|
|
411
|
+
"type": "string"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
"type": "null"
|
|
415
|
+
}
|
|
416
|
+
]
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
"type": "object"
|
|
420
|
+
},
|
|
421
|
+
"snap-id": {
|
|
422
|
+
"type": "string"
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
"required": [
|
|
426
|
+
"name",
|
|
427
|
+
"snap-id",
|
|
428
|
+
"snap",
|
|
429
|
+
"channel-map"
|
|
430
|
+
],
|
|
431
|
+
"type": "object"
|
|
432
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# generated by datamodel-codegen:
|
|
2
|
+
# filename: snaps_find_schema.json
|
|
3
|
+
# timestamp: 2024-09-17T01:18:24+00:00
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
from typing import Any, Dict, List, Optional
|
|
7
|
+
|
|
8
|
+
from pydantic import AliasChoices, AwareDatetime, BaseModel, ConfigDict, Field
|
|
9
|
+
|
|
10
|
+
from snap_python.schemas.store.categories import Category, Media
|
|
11
|
+
|
|
12
|
+
VALID_SEARCH_CATEGORY_FIELDS = [
|
|
13
|
+
"base",
|
|
14
|
+
"categories",
|
|
15
|
+
"channel",
|
|
16
|
+
"common-ids",
|
|
17
|
+
"confinement",
|
|
18
|
+
"contact",
|
|
19
|
+
"description",
|
|
20
|
+
"download",
|
|
21
|
+
"license",
|
|
22
|
+
"media",
|
|
23
|
+
"prices",
|
|
24
|
+
"private",
|
|
25
|
+
"publisher",
|
|
26
|
+
"revision",
|
|
27
|
+
"store-url",
|
|
28
|
+
"summary",
|
|
29
|
+
"title",
|
|
30
|
+
"type",
|
|
31
|
+
"version",
|
|
32
|
+
"website",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class ErrorListItem(BaseModel):
|
|
37
|
+
model_config = ConfigDict(extra="forbid", exclude_unset=True)
|
|
38
|
+
|
|
39
|
+
code: str
|
|
40
|
+
message: str
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class Download(BaseModel):
|
|
44
|
+
model_config = ConfigDict(extra="forbid", exclude_unset=True)
|
|
45
|
+
|
|
46
|
+
size: float
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class Revision(BaseModel):
|
|
50
|
+
model_config = ConfigDict(extra="forbid", exclude_unset=True)
|
|
51
|
+
|
|
52
|
+
base: Optional[str] = None
|
|
53
|
+
channel: Optional[str] = None
|
|
54
|
+
common_ids: Optional[List[str]] = Field(None, alias="common-ids")
|
|
55
|
+
confinement: Optional[str] = None
|
|
56
|
+
download: Optional[Download] = None
|
|
57
|
+
revision: Optional[float] = None
|
|
58
|
+
type: Optional[str] = None
|
|
59
|
+
version: Optional[str] = None
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class Publisher(BaseModel):
|
|
63
|
+
model_config = ConfigDict(extra="forbid", exclude_unset=True)
|
|
64
|
+
|
|
65
|
+
display_name: str = Field(
|
|
66
|
+
...,
|
|
67
|
+
alias="display-name",
|
|
68
|
+
description="Display name corresponding to the publisher.",
|
|
69
|
+
)
|
|
70
|
+
id: str = Field(..., description="The publisher id.")
|
|
71
|
+
username: str = Field(..., description="Username belonging to the publisher.")
|
|
72
|
+
validation: Optional[str] = Field(
|
|
73
|
+
None, description="Indicates if the account has been validated."
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class Snap(BaseModel):
|
|
78
|
+
model_config = ConfigDict(extra="forbid", exclude_unset=True)
|
|
79
|
+
|
|
80
|
+
categories: Optional[List[Category]] = None
|
|
81
|
+
contact: Optional[str] = None
|
|
82
|
+
description: Optional[str] = ""
|
|
83
|
+
gated_snap_ids: Optional[List[str]] = Field(
|
|
84
|
+
None, alias=AliasChoices("gated-snap-ids", "gated_snap_ids")
|
|
85
|
+
)
|
|
86
|
+
license: Optional[str] = None
|
|
87
|
+
links: Optional[Dict[str, Any]] = None
|
|
88
|
+
media: Optional[List[Media]] = None
|
|
89
|
+
name: Optional[str] = None
|
|
90
|
+
prices: Optional[Dict[str, Any]] = None
|
|
91
|
+
private: Optional[bool] = None
|
|
92
|
+
publisher: Optional[Publisher] = Field(None, description="The publisher.")
|
|
93
|
+
snap_id: Optional[str] = Field(None, alias=AliasChoices("snap-id", "snap_id"))
|
|
94
|
+
store_url: Optional[str] = Field(None, alias=AliasChoices("store-url", "store_url"))
|
|
95
|
+
summary: Optional[str] = None
|
|
96
|
+
title: Optional[str] = None
|
|
97
|
+
trending: Optional[bool] = None
|
|
98
|
+
unlisted: Optional[bool] = None
|
|
99
|
+
website: Optional[str] = None
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
class SnapDetails(BaseModel):
|
|
103
|
+
aliases: Optional[List[Dict]] = None
|
|
104
|
+
anon_download_url: str
|
|
105
|
+
apps: Optional[List[str]] = None
|
|
106
|
+
architecture: List[str]
|
|
107
|
+
base: Optional[str] = None
|
|
108
|
+
binary_filesize: int
|
|
109
|
+
channel: str
|
|
110
|
+
common_ids: List[str]
|
|
111
|
+
confinement: str
|
|
112
|
+
contact: Optional[str] = None
|
|
113
|
+
content: Optional[str] = None
|
|
114
|
+
date_published: AwareDatetime
|
|
115
|
+
deltas: Optional[List[str]] = None
|
|
116
|
+
description: str
|
|
117
|
+
developer_id: str
|
|
118
|
+
developer_name: str
|
|
119
|
+
developer_validation: str
|
|
120
|
+
download_sha3_384: Optional[str] = None
|
|
121
|
+
download_sha512: Optional[str] = None
|
|
122
|
+
download_url: str
|
|
123
|
+
epoch: str
|
|
124
|
+
gated_snap_ids: Optional[List[str]] = None
|
|
125
|
+
icon_url: str
|
|
126
|
+
last_updated: AwareDatetime
|
|
127
|
+
license: str
|
|
128
|
+
links: Dict[str, Any]
|
|
129
|
+
name: str
|
|
130
|
+
origin: str
|
|
131
|
+
package_name: str
|
|
132
|
+
prices: Dict[str, Any]
|
|
133
|
+
private: bool
|
|
134
|
+
publisher: str
|
|
135
|
+
raitings_average: float = 0.0
|
|
136
|
+
release: List[str]
|
|
137
|
+
revision: int
|
|
138
|
+
screenshot_urls: List[str]
|
|
139
|
+
snap_id: Optional[str] = None
|
|
140
|
+
summary: Optional[str] = None
|
|
141
|
+
support_url: Optional[str] = None
|
|
142
|
+
title: Optional[str] = None
|
|
143
|
+
version: Optional[str] = None
|
|
144
|
+
website: Optional[str] = None
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
class SearchResult(BaseModel):
|
|
148
|
+
model_config = ConfigDict(extra="forbid", exclude_unset=True, exclude_none=True)
|
|
149
|
+
|
|
150
|
+
name: str
|
|
151
|
+
revision: Optional[Revision] = None
|
|
152
|
+
snap: Snap
|
|
153
|
+
snap_id: str = Field(alias=AliasChoices("snap-id", "snap_id"))
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
class SearchResponse(BaseModel):
|
|
157
|
+
model_config = ConfigDict(extra="forbid", exclude_unset=True, exclude_none=True)
|
|
158
|
+
|
|
159
|
+
error_list: Optional[List[ErrorListItem]] = Field(None, alias="error-list")
|
|
160
|
+
results: List[SearchResult]
|
snap_python/utils.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
|
|
3
|
+
import httpx
|
|
4
|
+
|
|
5
|
+
from snap_python.schemas.changes import ChangesResponse
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class AbstractSnapsClient(ABC): # pragma: no cover
|
|
9
|
+
@abstractmethod
|
|
10
|
+
async def request(self) -> httpx.Response:
|
|
11
|
+
pass
|
|
12
|
+
|
|
13
|
+
@abstractmethod
|
|
14
|
+
async def request_raw(self) -> httpx.Response:
|
|
15
|
+
pass
|
|
16
|
+
|
|
17
|
+
@abstractmethod
|
|
18
|
+
async def get_changes_by_id(self, change_id: str) -> ChangesResponse:
|
|
19
|
+
pass
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Alexander Lukens
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: snap-python
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary:
|
|
5
|
+
License: MIT
|
|
6
|
+
Author: Alexander Lukens
|
|
7
|
+
Author-email: alexdlukens@gmail.com
|
|
8
|
+
Requires-Python: >=3.12,<4.0
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Requires-Dist: httpx (>=0.27.2,<0.28.0)
|
|
13
|
+
Requires-Dist: pydantic (>=2.9.2,<3.0.0)
|
|
14
|
+
Requires-Dist: retry (>=0.9.2,<0.10.0)
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# snap_python
|
|
18
|
+
|
|
19
|
+
snap_python provides an API client to interact with snapd
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
To install snap_python, you can use pip:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
pip install snap_python
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
Here is a simple example of how to use snap_python:
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
# TODO
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## License
|
|
38
|
+
|
|
39
|
+
This project is licensed under the MIT License. See the LICENSE file for more details.
|