dtool-info 0.16.3__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.
- dtool_info/__init__.py +9 -0
- dtool_info/dataset.py +459 -0
- dtool_info/inventory.py +167 -0
- dtool_info/overlay.py +70 -0
- dtool_info/templates/dtool_report.html.j2 +143 -0
- dtool_info/utils.py +17 -0
- dtool_info-0.16.3.dist-info/METADATA +60 -0
- dtool_info-0.16.3.dist-info/RECORD +11 -0
- dtool_info-0.16.3.dist-info/WHEEL +4 -0
- dtool_info-0.16.3.dist-info/entry_points.txt +12 -0
- dtool_info-0.16.3.dist-info/licenses/LICENSE.rst +22 -0
dtool_info/__init__.py
ADDED
dtool_info/dataset.py
ADDED
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
"""Commands for getting information about datasets."""
|
|
2
|
+
|
|
3
|
+
import sys
|
|
4
|
+
|
|
5
|
+
from operator import itemgetter
|
|
6
|
+
|
|
7
|
+
import click
|
|
8
|
+
|
|
9
|
+
import pygments
|
|
10
|
+
import pygments.lexers
|
|
11
|
+
import pygments.formatters
|
|
12
|
+
|
|
13
|
+
import dtoolcore
|
|
14
|
+
from dtoolcore.compare import (
|
|
15
|
+
diff_identifiers,
|
|
16
|
+
diff_sizes,
|
|
17
|
+
diff_content,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
from dtool_cli.cli import (
|
|
21
|
+
base_dataset_uri_argument,
|
|
22
|
+
dataset_uri_argument,
|
|
23
|
+
dataset_uri_validation,
|
|
24
|
+
CONFIG_PATH,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
from dtool_info.utils import sizeof_fmt, date_fmt
|
|
28
|
+
|
|
29
|
+
item_identifier_argument = click.argument("item_identifier")
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@click.command()
|
|
33
|
+
@click.option(
|
|
34
|
+
"-f",
|
|
35
|
+
"--full",
|
|
36
|
+
is_flag=True,
|
|
37
|
+
help="Include file hash comparisons."
|
|
38
|
+
)
|
|
39
|
+
@dataset_uri_argument
|
|
40
|
+
@click.argument("reference_dataset_uri", callback=dataset_uri_validation)
|
|
41
|
+
def diff(full, dataset_uri, reference_dataset_uri):
|
|
42
|
+
"""Report the difference between two datasets.
|
|
43
|
+
|
|
44
|
+
1. Checks that the identifiers are identicial
|
|
45
|
+
2. Checks that the sizes are identical
|
|
46
|
+
3. Checks that the hashes are identical, if the '--full' option is used
|
|
47
|
+
|
|
48
|
+
If a differences is detected in step 1, steps 2 and 3 will not be carried
|
|
49
|
+
out. Similarly if a difference is detected in step 2, step 3 will not be
|
|
50
|
+
carried out.
|
|
51
|
+
|
|
52
|
+
When checking that the hashes are identical the hashes for the first
|
|
53
|
+
dataset are recalculated using the hashing algorithm of the reference
|
|
54
|
+
dataset.
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
def echo_header(desc, ds_name, ref_ds_name, prop):
|
|
58
|
+
click.secho("Different {}".format(desc), fg="red")
|
|
59
|
+
click.secho("ID, {} in '{}', {} in '{}'".format(
|
|
60
|
+
prop, ds_name, prop, ref_ds_name))
|
|
61
|
+
|
|
62
|
+
def echo_diff(diff):
|
|
63
|
+
for d in diff:
|
|
64
|
+
line = "{}, {}, {}".format(d[0], d[1], d[2])
|
|
65
|
+
click.secho(line)
|
|
66
|
+
|
|
67
|
+
ds = dtoolcore.DataSet.from_uri(dataset_uri)
|
|
68
|
+
ref_ds = dtoolcore.DataSet.from_uri(reference_dataset_uri)
|
|
69
|
+
|
|
70
|
+
num_items = len(list(ref_ds.identifiers))
|
|
71
|
+
|
|
72
|
+
ids_diff = diff_identifiers(ds, ref_ds)
|
|
73
|
+
if len(ids_diff) > 0:
|
|
74
|
+
echo_header("identifiers", ds.name, ref_ds.name, "present")
|
|
75
|
+
echo_diff(ids_diff)
|
|
76
|
+
sys.exit(1)
|
|
77
|
+
|
|
78
|
+
with click.progressbar(length=num_items,
|
|
79
|
+
label="Comparing sizes") as progressbar:
|
|
80
|
+
sizes_diff = diff_sizes(ds, ref_ds, progressbar)
|
|
81
|
+
if len(sizes_diff) > 0:
|
|
82
|
+
echo_header("sizes", ds.name, ref_ds.name, "size")
|
|
83
|
+
echo_diff(sizes_diff)
|
|
84
|
+
sys.exit(2)
|
|
85
|
+
|
|
86
|
+
if full:
|
|
87
|
+
with click.progressbar(length=num_items,
|
|
88
|
+
label="Comparing hashes") as progressbar:
|
|
89
|
+
content_diff = diff_content(ds, ref_ds, progressbar)
|
|
90
|
+
if len(content_diff) > 0:
|
|
91
|
+
echo_header("content", ds.name, ref_ds.name, "hash")
|
|
92
|
+
echo_diff(content_diff)
|
|
93
|
+
sys.exit(3)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def _list_dataset_items(uri, quiet, verbose):
|
|
97
|
+
try:
|
|
98
|
+
dataset = dtoolcore.DataSet.from_uri(
|
|
99
|
+
uri=uri,
|
|
100
|
+
config_path=CONFIG_PATH
|
|
101
|
+
)
|
|
102
|
+
except dtoolcore.DtoolCoreTypeError:
|
|
103
|
+
click.secho(
|
|
104
|
+
"Cannot list the items of a proto dataset",
|
|
105
|
+
fg="red",
|
|
106
|
+
err=True
|
|
107
|
+
)
|
|
108
|
+
sys.exit(1)
|
|
109
|
+
|
|
110
|
+
content = []
|
|
111
|
+
for i in dataset.identifiers:
|
|
112
|
+
props = dataset.item_properties(i)
|
|
113
|
+
content.append({
|
|
114
|
+
"identifier": i,
|
|
115
|
+
"relpath": props["relpath"],
|
|
116
|
+
"size_in_bytes": props["size_in_bytes"]
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
for c in sorted(content, key=itemgetter("relpath")):
|
|
120
|
+
line = "{}\t{}".format(c["identifier"], c["relpath"])
|
|
121
|
+
if verbose:
|
|
122
|
+
line = "{}{} {}".format(
|
|
123
|
+
c["identifier"],
|
|
124
|
+
sizeof_fmt(c["size_in_bytes"]),
|
|
125
|
+
c["relpath"]
|
|
126
|
+
)
|
|
127
|
+
if quiet:
|
|
128
|
+
line = c["relpath"]
|
|
129
|
+
click.secho(line)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def _list_datasets(base_uri, quiet, verbose):
|
|
133
|
+
base_uri = dtoolcore.utils.sanitise_uri(base_uri)
|
|
134
|
+
StorageBroker = dtoolcore._get_storage_broker(base_uri, CONFIG_PATH)
|
|
135
|
+
info = []
|
|
136
|
+
for uri in StorageBroker.list_dataset_uris(base_uri, CONFIG_PATH):
|
|
137
|
+
admin_metadata = dtoolcore._admin_metadata_from_uri(uri, CONFIG_PATH)
|
|
138
|
+
fg = "green"
|
|
139
|
+
name = admin_metadata["name"]
|
|
140
|
+
if admin_metadata["type"] == "protodataset":
|
|
141
|
+
fg = "red"
|
|
142
|
+
name = "*" + name
|
|
143
|
+
i = dict(
|
|
144
|
+
name=name,
|
|
145
|
+
uuid=admin_metadata["uuid"],
|
|
146
|
+
creator=admin_metadata["creator_username"],
|
|
147
|
+
uri=uri,
|
|
148
|
+
fg=fg)
|
|
149
|
+
if "frozen_at" in admin_metadata:
|
|
150
|
+
i["date"] = date_fmt(admin_metadata["frozen_at"])
|
|
151
|
+
info.append(i)
|
|
152
|
+
|
|
153
|
+
if len(info) == 0:
|
|
154
|
+
sys.exit(0)
|
|
155
|
+
|
|
156
|
+
for i in info:
|
|
157
|
+
if quiet:
|
|
158
|
+
click.secho(i["uri"], fg=i["fg"])
|
|
159
|
+
continue
|
|
160
|
+
click.secho(i["name"], fg=i["fg"])
|
|
161
|
+
click.secho(" " + i["uri"])
|
|
162
|
+
if verbose:
|
|
163
|
+
click.secho(" " + i["creator"], nl=False)
|
|
164
|
+
if "date" in i:
|
|
165
|
+
click.secho(" " + i["date"], nl=False)
|
|
166
|
+
click.secho(" " + i["uuid"])
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
@click.command()
|
|
170
|
+
@click.option("-q", "--quiet", is_flag=True)
|
|
171
|
+
@click.option("-v", "--verbose", is_flag=True)
|
|
172
|
+
@click.argument("uri")
|
|
173
|
+
def ls(quiet, verbose, uri):
|
|
174
|
+
"""List datasets / items in a dataset.
|
|
175
|
+
|
|
176
|
+
If the URI is a dataset the items in the dataset will be listed.
|
|
177
|
+
It is not possible to list the items in a proto dataset.
|
|
178
|
+
|
|
179
|
+
If the URI is a location containing datasets the datasets will be listed.
|
|
180
|
+
Proto datasets are highlighted in red.
|
|
181
|
+
"""
|
|
182
|
+
if dtoolcore._is_dataset(uri, CONFIG_PATH):
|
|
183
|
+
_list_dataset_items(uri, quiet, verbose)
|
|
184
|
+
else:
|
|
185
|
+
_list_datasets(uri, quiet, verbose)
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
@click.command()
|
|
189
|
+
@dataset_uri_argument
|
|
190
|
+
def identifiers(dataset_uri):
|
|
191
|
+
"""List the item identifiers in the dataset."""
|
|
192
|
+
dataset = dtoolcore.DataSet.from_uri(dataset_uri)
|
|
193
|
+
for i in dataset.identifiers:
|
|
194
|
+
click.secho(i)
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
@click.command()
|
|
198
|
+
@dataset_uri_argument
|
|
199
|
+
@click.option(
|
|
200
|
+
"-f",
|
|
201
|
+
"--format",
|
|
202
|
+
type=click.Choice(["json"]),
|
|
203
|
+
help="Select the output format."
|
|
204
|
+
)
|
|
205
|
+
def summary(dataset_uri, format):
|
|
206
|
+
"""Report summary information about a dataset."""
|
|
207
|
+
dataset = dtoolcore.DataSet.from_uri(dataset_uri)
|
|
208
|
+
creator_username = dataset._admin_metadata["creator_username"]
|
|
209
|
+
frozen_at = dataset._admin_metadata["frozen_at"]
|
|
210
|
+
num_items = len(dataset.identifiers)
|
|
211
|
+
tot_size = sum([dataset.item_properties(i)["size_in_bytes"]
|
|
212
|
+
for i in dataset.identifiers])
|
|
213
|
+
|
|
214
|
+
if format == "json":
|
|
215
|
+
json_lines = [
|
|
216
|
+
'{',
|
|
217
|
+
' "name": "{}",'.format(dataset.name),
|
|
218
|
+
' "uuid": "{}",'.format(dataset.uuid),
|
|
219
|
+
' "creator_username": "{}",'.format(creator_username),
|
|
220
|
+
' "number_of_items": {},'.format(num_items),
|
|
221
|
+
' "size_in_bytes": {},'.format(tot_size),
|
|
222
|
+
' "frozen_at": {}'.format(frozen_at),
|
|
223
|
+
'}',
|
|
224
|
+
]
|
|
225
|
+
formatted_json = "\n".join(json_lines)
|
|
226
|
+
colorful_json = pygments.highlight(
|
|
227
|
+
formatted_json,
|
|
228
|
+
pygments.lexers.JsonLexer(),
|
|
229
|
+
pygments.formatters.TerminalFormatter())
|
|
230
|
+
click.secho(colorful_json, nl=False)
|
|
231
|
+
|
|
232
|
+
else:
|
|
233
|
+
info = [
|
|
234
|
+
("name", dataset.name),
|
|
235
|
+
("uuid", dataset.uuid),
|
|
236
|
+
("creator_username", creator_username),
|
|
237
|
+
("number_of_items", str(num_items)),
|
|
238
|
+
("size", sizeof_fmt(tot_size).strip()),
|
|
239
|
+
("frozen_at", date_fmt(frozen_at)),
|
|
240
|
+
]
|
|
241
|
+
for key, value in info:
|
|
242
|
+
click.secho("{}: ".format(key), nl=False)
|
|
243
|
+
click.secho(value, fg="green")
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
@click.group()
|
|
247
|
+
def item():
|
|
248
|
+
"""
|
|
249
|
+
Get information about an item in the dataset.
|
|
250
|
+
"""
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
@item.command()
|
|
254
|
+
@dataset_uri_argument
|
|
255
|
+
@item_identifier_argument
|
|
256
|
+
def properties(dataset_uri, item_identifier):
|
|
257
|
+
"""Report item properties."""
|
|
258
|
+
dataset = dtoolcore.DataSet.from_uri(dataset_uri)
|
|
259
|
+
try:
|
|
260
|
+
props = dataset.item_properties(item_identifier)
|
|
261
|
+
except KeyError:
|
|
262
|
+
click.secho(
|
|
263
|
+
"No such item in dataset: {}".format(item_identifier),
|
|
264
|
+
fg="red",
|
|
265
|
+
err=True
|
|
266
|
+
)
|
|
267
|
+
sys.exit(20)
|
|
268
|
+
|
|
269
|
+
json_lines = [
|
|
270
|
+
'{',
|
|
271
|
+
' "relpath": "{}",'.format(props["relpath"]),
|
|
272
|
+
' "size_in_bytes": {},'.format(props["size_in_bytes"]),
|
|
273
|
+
' "utc_timestamp": {},'.format(props["utc_timestamp"]),
|
|
274
|
+
' "hash": "{}"'.format(props["hash"]),
|
|
275
|
+
'}',
|
|
276
|
+
]
|
|
277
|
+
formatted_json = "\n".join(json_lines)
|
|
278
|
+
colorful_json = pygments.highlight(
|
|
279
|
+
formatted_json,
|
|
280
|
+
pygments.lexers.JsonLexer(),
|
|
281
|
+
pygments.formatters.TerminalFormatter())
|
|
282
|
+
click.secho(colorful_json, nl=False)
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
@item.command()
|
|
286
|
+
@dataset_uri_argument
|
|
287
|
+
@item_identifier_argument
|
|
288
|
+
def fetch(dataset_uri, item_identifier):
|
|
289
|
+
"""Return abspath to file with item content.
|
|
290
|
+
|
|
291
|
+
Fetches the file from remote storage if required.
|
|
292
|
+
"""
|
|
293
|
+
dataset = dtoolcore.DataSet.from_uri(dataset_uri)
|
|
294
|
+
click.secho(dataset.item_content_abspath(item_identifier))
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
@item.command()
|
|
298
|
+
@click.argument("overlay_name")
|
|
299
|
+
@dataset_uri_argument
|
|
300
|
+
@item_identifier_argument
|
|
301
|
+
def overlay(overlay_name, dataset_uri, item_identifier):
|
|
302
|
+
"""Return abspath to file with item content.
|
|
303
|
+
|
|
304
|
+
Fetches the file from remote storage if required.
|
|
305
|
+
"""
|
|
306
|
+
dataset = dtoolcore.DataSet.from_uri(dataset_uri)
|
|
307
|
+
if overlay_name not in dataset.list_overlay_names():
|
|
308
|
+
click.secho(
|
|
309
|
+
"No such overlay in dataset: {}".format(overlay_name),
|
|
310
|
+
fg="red",
|
|
311
|
+
err=True
|
|
312
|
+
)
|
|
313
|
+
sys.exit(4)
|
|
314
|
+
overlay = dataset.get_overlay(overlay_name)
|
|
315
|
+
|
|
316
|
+
try:
|
|
317
|
+
click.secho(str(overlay[item_identifier]))
|
|
318
|
+
except KeyError:
|
|
319
|
+
click.secho(
|
|
320
|
+
"No such identifier in overlay: {}".format(item_identifier),
|
|
321
|
+
fg="red",
|
|
322
|
+
err=True
|
|
323
|
+
)
|
|
324
|
+
sys.exit(5)
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
@item.command()
|
|
328
|
+
@dataset_uri_argument
|
|
329
|
+
@item_identifier_argument
|
|
330
|
+
def relpath(dataset_uri, item_identifier):
|
|
331
|
+
"""Return relpath associated with the item.
|
|
332
|
+
"""
|
|
333
|
+
dataset = dtoolcore.DataSet.from_uri(dataset_uri)
|
|
334
|
+
try:
|
|
335
|
+
props = dataset.item_properties(item_identifier)
|
|
336
|
+
except KeyError:
|
|
337
|
+
click.secho(
|
|
338
|
+
"No such item in dataset: {}".format(item_identifier),
|
|
339
|
+
fg="red",
|
|
340
|
+
err=True
|
|
341
|
+
)
|
|
342
|
+
sys.exit(21)
|
|
343
|
+
click.secho(props["relpath"])
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
@click.command()
|
|
347
|
+
@click.option(
|
|
348
|
+
"-f",
|
|
349
|
+
"--full",
|
|
350
|
+
is_flag=True,
|
|
351
|
+
help="Include file hash comparisons."
|
|
352
|
+
)
|
|
353
|
+
@dataset_uri_argument
|
|
354
|
+
def verify(full, dataset_uri):
|
|
355
|
+
"""Verify the integrity of a dataset.
|
|
356
|
+
"""
|
|
357
|
+
dataset = dtoolcore.DataSet.from_uri(dataset_uri)
|
|
358
|
+
all_okay = True
|
|
359
|
+
|
|
360
|
+
# Generate identifiers and sizes quickly without the
|
|
361
|
+
# hash calculation used when calling dataset.generate_manifest().
|
|
362
|
+
generated_sizes = {}
|
|
363
|
+
generated_relpaths = {}
|
|
364
|
+
for handle in dataset._storage_broker.iter_item_handles():
|
|
365
|
+
identifier = dtoolcore.utils.generate_identifier(handle)
|
|
366
|
+
size = dataset._storage_broker.get_size_in_bytes(handle)
|
|
367
|
+
relpath = dataset._storage_broker.get_relpath(handle)
|
|
368
|
+
generated_sizes[identifier] = size
|
|
369
|
+
generated_relpaths[identifier] = relpath
|
|
370
|
+
|
|
371
|
+
generated_identifiers = set(generated_sizes.keys())
|
|
372
|
+
manifest_identifiers = set(dataset.identifiers)
|
|
373
|
+
|
|
374
|
+
for i in generated_identifiers.difference(manifest_identifiers):
|
|
375
|
+
message = "Unknown item: {} {}".format(
|
|
376
|
+
i,
|
|
377
|
+
generated_relpaths[i]
|
|
378
|
+
)
|
|
379
|
+
click.secho(message, fg="red")
|
|
380
|
+
all_okay = False
|
|
381
|
+
|
|
382
|
+
for i in manifest_identifiers.difference(generated_identifiers):
|
|
383
|
+
message = "Missing item: {} {}".format(
|
|
384
|
+
i,
|
|
385
|
+
dataset.item_properties(i)["relpath"]
|
|
386
|
+
)
|
|
387
|
+
click.secho(message, fg="red")
|
|
388
|
+
all_okay = False
|
|
389
|
+
|
|
390
|
+
for i in manifest_identifiers.intersection(generated_identifiers):
|
|
391
|
+
generated_size = generated_sizes[i]
|
|
392
|
+
manifest_size = dataset.item_properties(i)["size_in_bytes"]
|
|
393
|
+
if generated_size != manifest_size:
|
|
394
|
+
message = "Altered item size: {} {}".format(
|
|
395
|
+
i,
|
|
396
|
+
dataset.item_properties(i)["relpath"]
|
|
397
|
+
)
|
|
398
|
+
click.secho(message, fg="red")
|
|
399
|
+
all_okay = False
|
|
400
|
+
|
|
401
|
+
if full:
|
|
402
|
+
generated_manifest = dataset.generate_manifest()
|
|
403
|
+
for i in manifest_identifiers.intersection(generated_identifiers):
|
|
404
|
+
generated_hash = generated_manifest["items"][i]["hash"]
|
|
405
|
+
manifest_hash = dataset.item_properties(i)["hash"]
|
|
406
|
+
if generated_hash != manifest_hash:
|
|
407
|
+
message = "Altered item hash: {} {}".format(
|
|
408
|
+
i,
|
|
409
|
+
dataset.item_properties(i)["relpath"]
|
|
410
|
+
)
|
|
411
|
+
click.secho(message, fg="red")
|
|
412
|
+
all_okay = False
|
|
413
|
+
|
|
414
|
+
if not all_okay:
|
|
415
|
+
sys.exit(1)
|
|
416
|
+
else:
|
|
417
|
+
click.secho("All good :)", fg="green")
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
@click.command()
|
|
421
|
+
@base_dataset_uri_argument
|
|
422
|
+
def status(dataset_uri):
|
|
423
|
+
"""Return dataset status (frozen or proto)."""
|
|
424
|
+
try:
|
|
425
|
+
dtoolcore.DataSet.from_uri(
|
|
426
|
+
uri=dataset_uri,
|
|
427
|
+
config_path=CONFIG_PATH
|
|
428
|
+
)
|
|
429
|
+
click.secho("frozen", fg="green")
|
|
430
|
+
except dtoolcore.DtoolCoreTypeError:
|
|
431
|
+
click.secho("proto", fg="red")
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
@click.command()
|
|
435
|
+
@base_dataset_uri_argument
|
|
436
|
+
def uri(dataset_uri):
|
|
437
|
+
"""Return full dataset URI.
|
|
438
|
+
|
|
439
|
+
Can be useful when working with absolute and relative paths.
|
|
440
|
+
"""
|
|
441
|
+
try:
|
|
442
|
+
ds = dtoolcore.DataSet.from_uri(
|
|
443
|
+
uri=dataset_uri,
|
|
444
|
+
config_path=CONFIG_PATH
|
|
445
|
+
)
|
|
446
|
+
except dtoolcore.DtoolCoreTypeError:
|
|
447
|
+
ds = dtoolcore.ProtoDataSet.from_uri(
|
|
448
|
+
uri=dataset_uri,
|
|
449
|
+
config_path=CONFIG_PATH
|
|
450
|
+
)
|
|
451
|
+
click.secho(ds.uri)
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
@click.command()
|
|
455
|
+
@dataset_uri_argument
|
|
456
|
+
def uuid(dataset_uri):
|
|
457
|
+
"""Return the UUID of the dataset."""
|
|
458
|
+
dataset = dtoolcore.DataSet.from_uri(dataset_uri)
|
|
459
|
+
click.secho(dataset.uuid)
|
dtool_info/inventory.py
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"""Logic for generating inventories of datasets."""
|
|
2
|
+
|
|
3
|
+
from operator import itemgetter
|
|
4
|
+
|
|
5
|
+
import click
|
|
6
|
+
|
|
7
|
+
from jinja2 import Environment, PackageLoader
|
|
8
|
+
|
|
9
|
+
import dtoolcore
|
|
10
|
+
|
|
11
|
+
from dtool_cli.cli import CONFIG_PATH
|
|
12
|
+
|
|
13
|
+
from dtool_info.utils import sizeof_fmt, date_fmt
|
|
14
|
+
|
|
15
|
+
JINJA2_ENV = Environment(loader=PackageLoader('dtool_info', 'templates'))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _dataset_info(dataset):
|
|
19
|
+
"""Return information about dataset as a dict."""
|
|
20
|
+
info = {}
|
|
21
|
+
|
|
22
|
+
info["uri"] = dataset.uri
|
|
23
|
+
info["uuid"] = dataset.uuid
|
|
24
|
+
|
|
25
|
+
# Computer and human readable size of dataset.
|
|
26
|
+
tot_size = sum([dataset.item_properties(i)["size_in_bytes"]
|
|
27
|
+
for i in dataset.identifiers])
|
|
28
|
+
info["size_int"] = tot_size
|
|
29
|
+
info["size_str"] = sizeof_fmt(tot_size)
|
|
30
|
+
|
|
31
|
+
info["creator"] = dataset._admin_metadata["creator_username"]
|
|
32
|
+
info["name"] = dataset._admin_metadata["name"]
|
|
33
|
+
|
|
34
|
+
info["date"] = date_fmt(dataset._admin_metadata["frozen_at"])
|
|
35
|
+
|
|
36
|
+
info["num_items"] = len(dataset.identifiers)
|
|
37
|
+
|
|
38
|
+
info["readme_content"] = dataset.get_readme_content()
|
|
39
|
+
|
|
40
|
+
return info
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _is_frozen_dataset(uri, CONFIG_PATH):
|
|
44
|
+
admin_metadata = dtoolcore._admin_metadata_from_uri(uri, CONFIG_PATH)
|
|
45
|
+
return admin_metadata["type"] == "dataset"
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def _base_uri_info(base_uri):
|
|
49
|
+
StorageBroker = dtoolcore._get_storage_broker(base_uri, CONFIG_PATH)
|
|
50
|
+
|
|
51
|
+
info = {}
|
|
52
|
+
info["total_size_int"] = 0
|
|
53
|
+
info["total_items"] = 0
|
|
54
|
+
info["datasets"] = []
|
|
55
|
+
|
|
56
|
+
for uri in StorageBroker.list_dataset_uris(base_uri, CONFIG_PATH):
|
|
57
|
+
if not _is_frozen_dataset(uri, CONFIG_PATH):
|
|
58
|
+
continue
|
|
59
|
+
dataset = dtoolcore.DataSet.from_uri(uri)
|
|
60
|
+
dataset_info = _dataset_info(dataset)
|
|
61
|
+
info["datasets"].append(dataset_info)
|
|
62
|
+
info["total_size_int"] += dataset_info["size_int"]
|
|
63
|
+
info["total_items"] += dataset_info["num_items"]
|
|
64
|
+
|
|
65
|
+
info["total_size_str"] = sizeof_fmt(info["total_size_int"])
|
|
66
|
+
info["num_datasets"] = len(info["datasets"])
|
|
67
|
+
info["datasets"] = sorted(info["datasets"], key=itemgetter("name"))
|
|
68
|
+
|
|
69
|
+
return info
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def _line_formats(info):
|
|
73
|
+
creator_max_len = max(
|
|
74
|
+
[len(ds["creator"]) for ds in info["datasets"]]
|
|
75
|
+
)
|
|
76
|
+
num_items_max_len = max(
|
|
77
|
+
[len(str(ds["num_items"])) for ds in info["datasets"]]
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
ds_words = [
|
|
81
|
+
"{size_str}",
|
|
82
|
+
"{" + "creator:{}".format(creator_max_len) + "}",
|
|
83
|
+
"{" + "num_items:{}".format(num_items_max_len) + "}",
|
|
84
|
+
"{date}",
|
|
85
|
+
"{name}",
|
|
86
|
+
]
|
|
87
|
+
|
|
88
|
+
ds_line_format = " ".join(ds_words)
|
|
89
|
+
|
|
90
|
+
total_items_offset = creator_max_len + num_items_max_len + 1
|
|
91
|
+
summary_words = [
|
|
92
|
+
"{total_size_str}",
|
|
93
|
+
"{" + "total_items:{}".format(total_items_offset) + "}",
|
|
94
|
+
]
|
|
95
|
+
summary_line_format = " ".join(summary_words)
|
|
96
|
+
return ds_line_format, summary_line_format
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def _cmd_line_report(info):
|
|
100
|
+
# Report on each individual dataset.
|
|
101
|
+
ds_line, summary_line = _line_formats(info)
|
|
102
|
+
for ds_info in sorted(
|
|
103
|
+
info["datasets"],
|
|
104
|
+
key=itemgetter("creator", "date", "name")
|
|
105
|
+
):
|
|
106
|
+
click.secho(ds_line.format(**ds_info))
|
|
107
|
+
|
|
108
|
+
# Summary report on all datasets in base_uri.
|
|
109
|
+
click.secho(summary_line.format(**info))
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def _html_report(info):
|
|
113
|
+
|
|
114
|
+
template = JINJA2_ENV.get_template("dtool_report.html.j2")
|
|
115
|
+
html = template.render(info)
|
|
116
|
+
click.secho(html)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
def _csv_tsv_header_items():
|
|
120
|
+
return [
|
|
121
|
+
"name",
|
|
122
|
+
"size_in_bytes",
|
|
123
|
+
"creator",
|
|
124
|
+
"num_items",
|
|
125
|
+
"date",
|
|
126
|
+
"uri"
|
|
127
|
+
]
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
def _csv_tsv_column_items(ds_info):
|
|
131
|
+
return [
|
|
132
|
+
ds_info["name"],
|
|
133
|
+
str(ds_info["size_int"]),
|
|
134
|
+
ds_info["creator"],
|
|
135
|
+
str(ds_info["num_items"]),
|
|
136
|
+
ds_info["date"],
|
|
137
|
+
ds_info["uri"]
|
|
138
|
+
]
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def _csv_tsv_report(info, separator):
|
|
142
|
+
click.secho(separator.join(_csv_tsv_header_items()))
|
|
143
|
+
for ds_info in info["datasets"]:
|
|
144
|
+
click.secho(separator.join(_csv_tsv_column_items(ds_info)))
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
@click.command()
|
|
148
|
+
@click.argument("uri")
|
|
149
|
+
@click.option(
|
|
150
|
+
"-f",
|
|
151
|
+
"--format",
|
|
152
|
+
type=click.Choice(["csv", "tsv", "html"]),
|
|
153
|
+
help="Select the output format."
|
|
154
|
+
)
|
|
155
|
+
def inventory(uri, format):
|
|
156
|
+
"""Generate an inventory of datasets in a base URI."""
|
|
157
|
+
base_uri = dtoolcore.utils.sanitise_uri(uri)
|
|
158
|
+
info = _base_uri_info(base_uri)
|
|
159
|
+
|
|
160
|
+
if format is None:
|
|
161
|
+
_cmd_line_report(info)
|
|
162
|
+
elif format == "csv":
|
|
163
|
+
_csv_tsv_report(info, ",")
|
|
164
|
+
elif format == "tsv":
|
|
165
|
+
_csv_tsv_report(info, "\t")
|
|
166
|
+
elif format == "html":
|
|
167
|
+
_html_report(info)
|
dtool_info/overlay.py
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""Commands for displaying dataset overlay information."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
import click
|
|
7
|
+
|
|
8
|
+
import pygments
|
|
9
|
+
import pygments.lexers
|
|
10
|
+
import pygments.formatters
|
|
11
|
+
|
|
12
|
+
import dtoolcore
|
|
13
|
+
|
|
14
|
+
from dtool_cli.cli import (
|
|
15
|
+
dataset_uri_argument,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@click.group()
|
|
20
|
+
def overlay():
|
|
21
|
+
"""
|
|
22
|
+
DEPRECATED: Get information about item metadata stored in overlays.
|
|
23
|
+
"""
|
|
24
|
+
click.secho(
|
|
25
|
+
"The ``dtool overlay`` command is deprecated",
|
|
26
|
+
fg="red",
|
|
27
|
+
err=True
|
|
28
|
+
)
|
|
29
|
+
click.secho(
|
|
30
|
+
"Use ``dtool overlays`` instead",
|
|
31
|
+
fg="red",
|
|
32
|
+
err=True
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@overlay.command()
|
|
37
|
+
@dataset_uri_argument
|
|
38
|
+
def ls(dataset_uri):
|
|
39
|
+
"""
|
|
40
|
+
DEPRECATED: List the overlays in the dataset.
|
|
41
|
+
"""
|
|
42
|
+
dataset = dtoolcore.DataSet.from_uri(dataset_uri)
|
|
43
|
+
for overlay_name in dataset.list_overlay_names():
|
|
44
|
+
click.secho(overlay_name)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@overlay.command()
|
|
48
|
+
@dataset_uri_argument
|
|
49
|
+
@click.argument("overlay_name")
|
|
50
|
+
def show(dataset_uri, overlay_name):
|
|
51
|
+
"""
|
|
52
|
+
DEPRECATED: Show the content of a specific overlay.
|
|
53
|
+
"""
|
|
54
|
+
dataset = dtoolcore.DataSet.from_uri(dataset_uri)
|
|
55
|
+
try:
|
|
56
|
+
overlay = dataset.get_overlay(overlay_name)
|
|
57
|
+
except: # NOQA
|
|
58
|
+
click.secho(
|
|
59
|
+
"No such overlay: {}".format(overlay_name),
|
|
60
|
+
fg="red",
|
|
61
|
+
err=True
|
|
62
|
+
)
|
|
63
|
+
sys.exit(11)
|
|
64
|
+
|
|
65
|
+
formatted_json = json.dumps(overlay, indent=2)
|
|
66
|
+
colorful_json = pygments.highlight(
|
|
67
|
+
formatted_json,
|
|
68
|
+
pygments.lexers.JsonLexer(),
|
|
69
|
+
pygments.formatters.TerminalFormatter())
|
|
70
|
+
click.secho(colorful_json, nl=False)
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
|
|
6
|
+
<script>
|
|
7
|
+
function toggleContent(id) {
|
|
8
|
+
var x = document.getElementById(id);
|
|
9
|
+
if (x.style.display === "none") {
|
|
10
|
+
x.style.display = "block";
|
|
11
|
+
} else {
|
|
12
|
+
x.style.display = "none";
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<style>
|
|
18
|
+
body {
|
|
19
|
+
padding-left: 1em;
|
|
20
|
+
padding-right: 1em;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
h3.datasets {
|
|
24
|
+
padding-top: 0.5em;
|
|
25
|
+
}
|
|
26
|
+
ul.datasets {
|
|
27
|
+
margin: 0;
|
|
28
|
+
padding: 0;
|
|
29
|
+
}
|
|
30
|
+
li.datasets {
|
|
31
|
+
list-style-type: none;
|
|
32
|
+
background-color: #E8EAF6;
|
|
33
|
+
padding-left: 0.5em;
|
|
34
|
+
padding-right: 0.5em;
|
|
35
|
+
padding-bottom: 0.5em;
|
|
36
|
+
border-radius: 10px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
table {
|
|
40
|
+
border-collapse: collapse;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
table, th, td {
|
|
44
|
+
border: 2px solid #9FA8DA;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
th.datasets, td.datasets {
|
|
48
|
+
padding: 0.3em;
|
|
49
|
+
white-space: nowrap;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
td.datasets:last-child {
|
|
53
|
+
width: 100%;
|
|
54
|
+
white-space: normal;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
th.summary, td.summary {
|
|
58
|
+
padding: 0.5em;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
th.summary {
|
|
62
|
+
text-align: right;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
td.summary {
|
|
66
|
+
text-align: left;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
button {
|
|
70
|
+
margin-top: 1em;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
a {
|
|
74
|
+
color: black;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
pre.readme {
|
|
78
|
+
border: 2px solid #9FA8DA;
|
|
79
|
+
padding: 0.3em;
|
|
80
|
+
margin-top: 1em;
|
|
81
|
+
margin-bottom: 0;
|
|
82
|
+
}
|
|
83
|
+
</style>
|
|
84
|
+
|
|
85
|
+
<title>Dtool Report</title>
|
|
86
|
+
</head>
|
|
87
|
+
|
|
88
|
+
<body>
|
|
89
|
+
<h1>Dtool Report</h1>
|
|
90
|
+
|
|
91
|
+
<h2>Summary</h2>
|
|
92
|
+
|
|
93
|
+
<table class="summary">
|
|
94
|
+
<tr>
|
|
95
|
+
<th class="summary">Number of datasets</th>
|
|
96
|
+
<td class="summary">{{ num_datasets }}</td>
|
|
97
|
+
</tr>
|
|
98
|
+
<tr>
|
|
99
|
+
<th class="summary">Total number of items</th>
|
|
100
|
+
<td class="summary">{{ total_items }}</td>
|
|
101
|
+
</tr>
|
|
102
|
+
<tr>
|
|
103
|
+
<th class="summary">Total size</th>
|
|
104
|
+
<td class="summary">{{ total_size_str }}</td>
|
|
105
|
+
</tr>
|
|
106
|
+
</table>
|
|
107
|
+
|
|
108
|
+
<h2>Datasets</h2>
|
|
109
|
+
|
|
110
|
+
<ul class="datasets">
|
|
111
|
+
{% for ds in datasets %}
|
|
112
|
+
<li class="datasets">
|
|
113
|
+
<h3 class="datasets">
|
|
114
|
+
{{ ds.name }}
|
|
115
|
+
</h3>
|
|
116
|
+
|
|
117
|
+
<table class="datasets">
|
|
118
|
+
<tr>
|
|
119
|
+
<th class="datasets">Size</th>
|
|
120
|
+
<th class="datasets">Creator</th>
|
|
121
|
+
<th class="datasets">Num Items</th>
|
|
122
|
+
<th class="datasets">Creation Date</th>
|
|
123
|
+
<th class="datasets">URI</th>
|
|
124
|
+
</tr>
|
|
125
|
+
<tr>
|
|
126
|
+
<td class="datasets">{{ ds.size_str }}</td>
|
|
127
|
+
<td class="datasets">{{ ds.creator }}</td>
|
|
128
|
+
<td class="datasets">{{ ds.num_items }}</td>
|
|
129
|
+
<td class="datasets">{{ ds.date }}</td>
|
|
130
|
+
<td class="datasets"><a href={{ ds.uri }}>{{ ds.uri }}</a></td>
|
|
131
|
+
</tr>
|
|
132
|
+
</table>
|
|
133
|
+
|
|
134
|
+
<pre class="readme" id="readme.{{ ds.uuid }}" style="display: none">{{ ds.readme_content }}</pre>
|
|
135
|
+
<button onclick=toggleContent("readme.{{ ds.uuid }}")>Toggle README</button>
|
|
136
|
+
|
|
137
|
+
</li>
|
|
138
|
+
{% endfor %}
|
|
139
|
+
</ul>
|
|
140
|
+
|
|
141
|
+
</body>
|
|
142
|
+
|
|
143
|
+
</html>
|
dtool_info/utils.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""Utility functions."""
|
|
2
|
+
|
|
3
|
+
import datetime
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def sizeof_fmt(num, suffix='B'):
|
|
7
|
+
for unit in ['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi']:
|
|
8
|
+
if abs(num) < 1024.0:
|
|
9
|
+
return "{:6.1f}{:3s}".format(num, unit + suffix)
|
|
10
|
+
num /= 1024.0
|
|
11
|
+
return "{:6.1f}{:3s}".format(num, "Yi" + suffix)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def date_fmt(timestamp):
|
|
15
|
+
timestamp = float(timestamp)
|
|
16
|
+
datetime_obj = datetime.datetime.fromtimestamp(timestamp)
|
|
17
|
+
return datetime_obj.strftime("%Y-%m-%d")
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: dtool-info
|
|
3
|
+
Version: 0.16.3
|
|
4
|
+
Summary: Dtool plugin for getting information about datasets
|
|
5
|
+
Project-URL: Repository, https://github.com/jic-dtool/dtool-info
|
|
6
|
+
Author-email: Tjelvar Olsson <tjelvar.olsson@gmail.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE.rst
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
|
+
Requires-Dist: click
|
|
11
|
+
Requires-Dist: dtool-cli>=0.7.2
|
|
12
|
+
Requires-Dist: dtoolcore>=3.0.0
|
|
13
|
+
Requires-Dist: jinja2
|
|
14
|
+
Requires-Dist: pygments
|
|
15
|
+
Description-Content-Type: text/x-rst
|
|
16
|
+
|
|
17
|
+
dtool CLI commands for getting information about datasets
|
|
18
|
+
=========================================================
|
|
19
|
+
|
|
20
|
+
.. image:: https://badge.fury.io/py/dtool-info.svg
|
|
21
|
+
:target: http://badge.fury.io/py/dtool-info
|
|
22
|
+
:alt: PyPi package
|
|
23
|
+
|
|
24
|
+
.. image:: https://github.com/jic-dtool/dtool-info/actions/workflows/test.yml/badge.svg?branch=main
|
|
25
|
+
:target: https://github.com/jic-dtool/dtool-info/actions/workflows/test.yml
|
|
26
|
+
:alt: Tests
|
|
27
|
+
|
|
28
|
+
.. image:: https://codecov.io/github/jic-dtool/dtool-info/coverage.svg?branch=main
|
|
29
|
+
:target: https://codecov.io/github/jic-dtool/dtool-info?branch=main
|
|
30
|
+
:alt: Code Coverage
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
Installation
|
|
34
|
+
------------
|
|
35
|
+
|
|
36
|
+
.. code-block:: bash
|
|
37
|
+
|
|
38
|
+
pip install dtool-info
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
Example usage
|
|
42
|
+
-------------
|
|
43
|
+
|
|
44
|
+
Listing datasets in ``~/my_dataset`` directory::
|
|
45
|
+
|
|
46
|
+
dtool ls ~/my_datasets
|
|
47
|
+
|
|
48
|
+
Getting summary information about a dataset::
|
|
49
|
+
|
|
50
|
+
dtool summary ~/my_datasets/example_dataset
|
|
51
|
+
|
|
52
|
+
See the `dtool documentation <http://dtool.readthedocs.io>`_ for more detail.
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
Related packages
|
|
56
|
+
----------------
|
|
57
|
+
|
|
58
|
+
- `dtoolcore <https://github.com/jic-dtool/dtoolcore>`_
|
|
59
|
+
- `dtool-cli <https://github.com/jic-dtool/dtool-cli>`_
|
|
60
|
+
- `dtool-create <https://github.com/jic-dtool/dtool-create>`_
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
dtool_info/__init__.py,sha256=MtxAfUe8Z3lyuQNcTLyfhZEjkWlM3Qktl9FJBJ6JtFE,223
|
|
2
|
+
dtool_info/dataset.py,sha256=hedGf8zQtpYT40m3THist2DR-RPOHdB-ogqfwzfryCI,13833
|
|
3
|
+
dtool_info/inventory.py,sha256=4Mhl6xKYFFcOkfv1O_03tiesMujR7CXrIxfPWX4ynKg,4442
|
|
4
|
+
dtool_info/overlay.py,sha256=nm6bJXtyGmKHYcZgxbcQv0fUxksThSfPrV5S6JA1pGs,1557
|
|
5
|
+
dtool_info/utils.py,sha256=CU9ndstIa6_CgjJ0RWrfR_CGhbgyupGDnsiCNzG6VYE,474
|
|
6
|
+
dtool_info/templates/dtool_report.html.j2,sha256=FhlVR4NSYV67k5T61QldwvYgq85fhcd-kqQHjycOvMY,2429
|
|
7
|
+
dtool_info-0.16.3.dist-info/METADATA,sha256=C5FTVaz9P-z0iX0lcRw-fONxcNhRlh958dyvGeRCEcU,1662
|
|
8
|
+
dtool_info-0.16.3.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
9
|
+
dtool_info-0.16.3.dist-info/entry_points.txt,sha256=3-h0UHUh83rzmdz6XsoRV8sA96-LUfXOU_AGFFGNk6U,393
|
|
10
|
+
dtool_info-0.16.3.dist-info/licenses/LICENSE.rst,sha256=86aJiAkXSLnTuXcSVW8_TVdYTbp2of-veyzp3a3A3uA,1083
|
|
11
|
+
dtool_info-0.16.3.dist-info/RECORD,,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
[dtool.cli]
|
|
2
|
+
diff = dtool_info.dataset:diff
|
|
3
|
+
identifiers = dtool_info.dataset:identifiers
|
|
4
|
+
inventory = dtool_info.inventory:inventory
|
|
5
|
+
item = dtool_info.dataset:item
|
|
6
|
+
ls = dtool_info.dataset:ls
|
|
7
|
+
overlay = dtool_info.overlay:overlay
|
|
8
|
+
status = dtool_info.dataset:status
|
|
9
|
+
summary = dtool_info.dataset:summary
|
|
10
|
+
uri = dtool_info.dataset:uri
|
|
11
|
+
uuid = dtool_info.dataset:uuid
|
|
12
|
+
verify = dtool_info.dataset:verify
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
===========
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2017 Tjelvar Olsson
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|