1
1
2
- socketdev -python-sdk
3
- ###############
2
+ socket -python-sdk
3
+ #################
4
4
5
5
Purpose
6
6
-------
@@ -14,8 +14,13 @@ Initializing the module
14
14
15
15
.. code-block ::
16
16
17
- from socketdev import SocketDev
18
- socket = SocketDev("REPLACE_ME")
17
+ from socketdev import socketdev
18
+ socket = socketdev(token="REPLACE_ME", timeout=30)
19
+
20
+ **PARAMETERS: **
21
+
22
+ - **token (str) ** - The Socket API Key for your Organization
23
+ - **Timeout (int) ** - The number of seconds to wait before failing the connection
19
24
20
25
Supported Functions
21
26
-------------------
@@ -28,8 +33,8 @@ Retrieve the Issues associated with a package and version.
28
33
29
34
.. code-block ::
30
35
31
- from socketdev import SocketDev
32
- socket = SocketDev( "REPLACE_ME")
36
+ from socketdev import socketdev
37
+ socket = socketdev(token= "REPLACE_ME")
33
38
print(socket.npm.issues("hardhat-gas-report", "1.1.25"))
34
39
35
40
**PARAMETERS: **
@@ -45,8 +50,8 @@ Retrieve the Issues associated with a package and version.
45
50
46
51
.. code-block ::
47
52
48
- from socketdev import SocketDev
49
- socket = SocketDev( "REPLACE_ME")
53
+ from socketdev import socketdev
54
+ socket = socketdev(token= "REPLACE_ME")
50
55
print(socket.npm.score("hardhat-gas-report", "1.1.25"))
51
56
52
57
**PARAMETERS: **
@@ -55,15 +60,15 @@ Retrieve the Issues associated with a package and version.
55
60
- **version (str) ** - The version of the NPM Package.
56
61
57
62
dependencies.get(limit, offset)
58
- """"""""""""""""""
63
+ """""""""""""""""""""""""""""""
59
64
Retrieve the dependencies for the organization associated with the API Key
60
65
61
66
**Usage: **
62
67
63
68
.. code-block ::
64
69
65
- from socketdev import SocketDev
66
- socket = SocketDev( "REPLACE_ME")
70
+ from socketdev import socketdev
71
+ socket = socketdev(token= "REPLACE_ME")
67
72
print(socket.dependencies.get(10, 0))
68
73
69
74
**PARAMETERS: **
@@ -79,8 +84,8 @@ Retrieve the dependencies for the organization associated with the API Key
79
84
80
85
.. code-block ::
81
86
82
- from socketdev import SocketDev
83
- socket = SocketDev( "REPLACE_ME")
87
+ from socketdev import socketdev
88
+ socket = socketdev(token= "REPLACE_ME")
84
89
file_names = [
85
90
"path/to/package.json"
86
91
]
@@ -103,8 +108,8 @@ Retrieve the Socket.dev org information
103
108
104
109
.. code-block ::
105
110
106
- from socketdev import SocketDev
107
- socket = SocketDev( "REPLACE_ME")
111
+ from socketdev import socketdev
112
+ socket = socketdev(token= "REPLACE_ME")
108
113
print(socket.org.get())
109
114
110
115
quota.get()
@@ -115,8 +120,8 @@ Retrieve the the current quota available for your API Key
115
120
116
121
.. code-block ::
117
122
118
- from socketdev import SocketDev
119
- socket = SocketDev( "REPLACE_ME")
123
+ from socketdev import socketdev
124
+ socket = socketdev(token= "REPLACE_ME")
120
125
print(socket.quota.get())
121
126
122
127
report.list()
@@ -127,9 +132,13 @@ Retrieve the list of all reports for the organization
127
132
128
133
.. code-block ::
129
134
130
- from socketdev import SocketDev
131
- socket = SocketDev("REPLACE_ME")
132
- print(socket.report.list())
135
+ from socketdev import socketdev
136
+ socket = socketdev(token="REPLACE_ME")
137
+ print(socket.report.list(from_time=1726183485))
138
+
139
+ **PARAMETERS: **
140
+
141
+ - **from_time (int) ** - The Unix Timestamp in Seconds to limit the reports pulled
133
142
134
143
report.delete(report_id)
135
144
""""""""""""""""""""""""
@@ -139,8 +148,8 @@ Delete the specified report
139
148
140
149
.. code-block ::
141
150
142
- from socketdev import SocketDev
143
- socket = SocketDev( "REPLACE_ME")
151
+ from socketdev import socketdev
152
+ socket = socketdev(token= "REPLACE_ME")
144
153
print(socket.report.delete("report-id"))
145
154
146
155
**PARAMETERS: **
@@ -155,8 +164,8 @@ Retrieve the information for a Project Health Report
155
164
156
165
.. code-block ::
157
166
158
- from socketdev import SocketDev
159
- socket = SocketDev( "REPLACE_ME")
167
+ from socketdev import socketdev
168
+ socket = socketdev(token= "REPLACE_ME")
160
169
print(socket.report.view("report_id"))
161
170
162
171
**PARAMETERS: **
@@ -171,8 +180,8 @@ Retrieve the supported types of manifest files for creating a report
171
180
172
181
.. code-block ::
173
182
174
- from socketdev import SocketDev
175
- socket = SocketDev( "REPLACE_ME")
183
+ from socketdev import socketdev
184
+ socket = socketdev(token= "REPLACE_ME")
176
185
print(socket.report.supported())
177
186
178
187
report.create(files)
@@ -183,8 +192,8 @@ Create a new project health report with the provided files
183
192
184
193
.. code-block ::
185
194
186
- from socketdev import SocketDev
187
- socket = SocketDev( "REPLACE_ME")
195
+ from socketdev import socketdev
196
+ socket = socketdev(token= "REPLACE_ME")
188
197
files = [
189
198
"/path/to/manifest/package.json"
190
199
]
@@ -202,8 +211,8 @@ Get a list of information about the tracked repositores
202
211
203
212
.. code-block ::
204
213
205
- from socketdev import SocketDev
206
- socket = SocketDev( "REPLACE_ME")
214
+ from socketdev import socketdev
215
+ socket = socketdev(token= "REPLACE_ME")
207
216
print(socket.repositories.get())
208
217
209
218
settings.get()
@@ -214,36 +223,36 @@ Retrieve the Socket Organization Settings
214
223
215
224
.. code-block ::
216
225
217
- from socketdev import SocketDev
218
- socket = SocketDev( "REPLACE_ME")
226
+ from socketdev import socketdev
227
+ socket = socketdev(token= "REPLACE_ME")
219
228
print(socket.settings.get())
220
229
221
230
sbom.view(report_id)
222
- """"""""""""""""""""""
231
+ """"""""""""""""""""
223
232
Retrieve the information for a SBOM Report
224
233
225
234
**Usage: **
226
235
227
236
.. code-block ::
228
237
229
- from socketdev import SocketDev
230
- socket = SocketDev( "REPLACE_ME")
238
+ from socketdev import socketdev
239
+ socket = socketdev(token= "REPLACE_ME")
231
240
print(socket.sbom.view("report_id"))
232
241
233
242
**PARAMETERS: **
234
243
235
244
- **report_id (str) ** - The report ID of the report to view
236
245
237
246
purl.post(license, components)
238
- """"""""""""""""""""""
247
+ """"""""""""""""""""""""""""""
239
248
Retrieve the package information for a purl post
240
249
241
250
**Usage: **
242
251
243
252
.. code-block ::
244
253
245
- from socketdev import SocketDev
246
- socket = SocketDev( "REPLACE_ME")
254
+ from socketdev import socketdev
255
+ socket = socketdev(token= "REPLACE_ME")
247
256
license = "true"
248
257
components = [
249
258
{
@@ -261,31 +270,31 @@ Retrieve the package information for a purl post
261
270
- **components (array{dict}) ** - The components list of packages urls
262
271
263
272
fullscans.get(org_slug)
264
- """"""""""""""""""""""
273
+ """""""""""""""""""""""
265
274
Retrieve the Fullscans information for around Organization
266
275
267
276
**Usage: **
268
277
269
278
.. code-block ::
270
279
271
- from socketdev import SocketDev
272
- socket = SocketDev( "REPLACE_ME")
280
+ from socketdev import socketdev
281
+ socket = socketdev(token= "REPLACE_ME")
273
282
print(socket.fullscans.get("org_slug"))
274
283
275
284
**PARAMETERS: **
276
285
277
286
- **org_slug (str) ** - The organization name
278
287
279
288
fullscans.post(files, params)
280
- """"""""""""""""""""""
289
+ """""""""""""""""""""""""""""
281
290
Create a full scan from a set of package manifest files. Returns a full scan including all SBOM artifacts.
282
291
283
292
**Usage: **
284
293
285
294
.. code-block ::
286
295
287
- from socketdev import SocketDev
288
- socket = SocketDev( "REPLACE_ME")
296
+ from socketdev import socketdev
297
+ socket = socketdev(token= "REPLACE_ME")
289
298
files = [
290
299
"/path/to/manifest/package.json"
291
300
]
@@ -335,15 +344,15 @@ Create a full scan from a set of package manifest files. Returns a full scan inc
335
344
+------------------------+------------+-------------------------------------------------------------------------------+
336
345
337
346
fullscans.delete(org_slug, full_scan_id)
338
- """"""""""""""""""""""
347
+ """"""""""""""""""""""""""""""""""""""""
339
348
Delete an existing full scan.
340
349
341
350
**Usage: **
342
351
343
352
.. code-block ::
344
353
345
- from socketdev import SocketDev
346
- socket = SocketDev( "REPLACE_ME")
354
+ from socketdev import socketdev
355
+ socket = socketdev(token= "REPLACE_ME")
347
356
print(socket.fullscans.delete(org_slug, full_scan_id))
348
357
349
358
**PARAMETERS: **
@@ -352,15 +361,15 @@ Delete an existing full scan.
352
361
- **full_scan_id (str) ** - The ID of the full scan
353
362
354
363
fullscans.stream(org_slug, full_scan_id)
355
- """"""""""""""""""""""
364
+ """"""""""""""""""""""""""""""""""""""""
356
365
Stream all SBOM artifacts for a full scan.
357
366
358
367
**Usage: **
359
368
360
369
.. code-block ::
361
370
362
- from socketdev import SocketDev
363
- socket = SocketDev( "REPLACE_ME")
371
+ from socketdev import socketdev
372
+ socket = socketdev(token= "REPLACE_ME")
364
373
print(socket.fullscans.stream(org_slug, full_scan_id))
365
374
366
375
**PARAMETERS: **
@@ -369,15 +378,15 @@ Stream all SBOM artifacts for a full scan.
369
378
- **full_scan_id (str) ** - The ID of the full scan
370
379
371
380
fullscans.metadata(org_slug, full_scan_id)
372
- """"""""""""""""""""""
381
+ """"""""""""""""""""""""""""""""""""""""""
373
382
Get metadata for a single full scan
374
383
375
384
**Usage: **
376
385
377
386
.. code-block ::
378
387
379
- from socketdev import SocketDev
380
- socket = SocketDev( "REPLACE_ME")
388
+ from socketdev import socketdev
389
+ socket = socketdev(token= "REPLACE_ME")
381
390
print(socket.fullscans.metadata(org_slug, full_scan_id))
382
391
383
392
**PARAMETERS: **
0 commit comments