dump-things-pyclient 0.1.3__py3-none-any.whl → 0.1.4__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.
- dump_things_pyclient/commands/auto_curate.py +21 -1
- {dump_things_pyclient-0.1.3.dist-info → dump_things_pyclient-0.1.4.dist-info}/METADATA +1 -1
- {dump_things_pyclient-0.1.3.dist-info → dump_things_pyclient-0.1.4.dist-info}/RECORD +6 -6
- {dump_things_pyclient-0.1.3.dist-info → dump_things_pyclient-0.1.4.dist-info}/WHEEL +0 -0
- {dump_things_pyclient-0.1.3.dist-info → dump_things_pyclient-0.1.4.dist-info}/entry_points.txt +0 -0
- {dump_things_pyclient-0.1.3.dist-info → dump_things_pyclient-0.1.4.dist-info}/top_level.txt +0 -0
|
@@ -64,6 +64,12 @@ def _main():
|
|
|
64
64
|
default=[],
|
|
65
65
|
help='exclude an inbox on the source collection (repeatable)',
|
|
66
66
|
)
|
|
67
|
+
argument_parser.add_argument(
|
|
68
|
+
'-i', '--include',
|
|
69
|
+
action='append',
|
|
70
|
+
default=[],
|
|
71
|
+
help='process only the given inbox, all other inboxes are ignored (repeatable, -e/--exclude is applied after inclusion)',
|
|
72
|
+
)
|
|
67
73
|
argument_parser.add_argument(
|
|
68
74
|
'-l', '--list-labels',
|
|
69
75
|
action='store_true',
|
|
@@ -79,6 +85,11 @@ def _main():
|
|
|
79
85
|
action='append',
|
|
80
86
|
help='if provided, process only records that match the given PIDs. NOTE: matching does not involve CURIE-resolution!',
|
|
81
87
|
)
|
|
88
|
+
argument_parser.add_argument(
|
|
89
|
+
'-d', '--dry-run',
|
|
90
|
+
action='store_true',
|
|
91
|
+
help='if provided, do not alter any data, instead print what would be done',
|
|
92
|
+
)
|
|
82
93
|
arguments = argument_parser.parse_args()
|
|
83
94
|
|
|
84
95
|
curator_token = os.environ.get(token_name)
|
|
@@ -107,6 +118,10 @@ def _main():
|
|
|
107
118
|
collection=arguments.collection,
|
|
108
119
|
token=curator_token):
|
|
109
120
|
|
|
121
|
+
if arguments.include and label not in arguments.include:
|
|
122
|
+
logger.debug('ignoring non-included incoming label: %s', label)
|
|
123
|
+
continue
|
|
124
|
+
|
|
110
125
|
if label in arguments.exclude:
|
|
111
126
|
logger.debug('ignoring excluded incoming label: %s', label)
|
|
112
127
|
continue
|
|
@@ -141,7 +156,7 @@ def _main():
|
|
|
141
156
|
# `record_dir+stl`, or `sqlite+stl`.
|
|
142
157
|
try:
|
|
143
158
|
class_name = re.search('([_A-Za-z0-9]*$)', record['schema_type']).group(0)
|
|
144
|
-
except IndexError:
|
|
159
|
+
except (IndexError, KeyError):
|
|
145
160
|
global stl_info
|
|
146
161
|
if not stl_info:
|
|
147
162
|
print(
|
|
@@ -159,6 +174,11 @@ def _main():
|
|
|
159
174
|
flush=True)
|
|
160
175
|
continue
|
|
161
176
|
|
|
177
|
+
if arguments.dry_run:
|
|
178
|
+
print(f'WRITE record "{record["pid"]}" of class "{class_name}" to "{destination_collection}@{destination_url}"')
|
|
179
|
+
print(f'DELETE record "{record["pid"]}" from inbox "{label}" of "{arguments.collection}@{arguments.service_url}"')
|
|
180
|
+
continue
|
|
181
|
+
|
|
162
182
|
# Store record in destination collection
|
|
163
183
|
curated_write_record(
|
|
164
184
|
service_url=destination_url,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
dump_things_pyclient/__init__.py,sha256=cn-U3TRIalN6aYHp1cMBRkQm1x98XBwquLFbgFEIf_Q,113
|
|
2
2
|
dump_things_pyclient/communicate.py,sha256=CTkgEigu16BmLrlJScMQKhHLI_W4SywDb4HCwAICWzA,30523
|
|
3
3
|
dump_things_pyclient/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
dump_things_pyclient/commands/auto_curate.py,sha256=
|
|
4
|
+
dump_things_pyclient/commands/auto_curate.py,sha256=T2aUQ1NWWr9OMUw0vQveMen4d18y6-gY4xcyajX9ACY,7716
|
|
5
5
|
dump_things_pyclient/commands/get_records.py,sha256=ErNC75ukrMTlOmKz6y1yF9F7HqJ-KdzksH4qMDnXPBI,6969
|
|
6
6
|
dump_things_pyclient/commands/json2ttl.py,sha256=8BkvdjLWZ_H0L6fTmuR2M2MglKiMUiuNUcuWr_w6_dQ,2133
|
|
7
7
|
dump_things_pyclient/commands/post_records.py,sha256=3Q0aPMVtXG6azRzzVa0pBzZYJaAi3VqkLHjGwK0X6To,1503
|
|
8
8
|
dump_things_pyclient/commands/read_pages.py,sha256=YuJUJeM_YwGR6D2-YJg1HYY2uD6j27QEItFXs5TzvYQ,3214
|
|
9
|
-
dump_things_pyclient-0.1.
|
|
10
|
-
dump_things_pyclient-0.1.
|
|
11
|
-
dump_things_pyclient-0.1.
|
|
12
|
-
dump_things_pyclient-0.1.
|
|
13
|
-
dump_things_pyclient-0.1.
|
|
9
|
+
dump_things_pyclient-0.1.4.dist-info/METADATA,sha256=PWlmmLd1zo0YKdiu7ZNjOzEVcCuaq8Q6GTT0CGRGSl8,942
|
|
10
|
+
dump_things_pyclient-0.1.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
11
|
+
dump_things_pyclient-0.1.4.dist-info/entry_points.txt,sha256=-LKTUNP6RJWBrzjXY8xdMhQsTS1zgvRsLJpsO7FipmQ,317
|
|
12
|
+
dump_things_pyclient-0.1.4.dist-info/top_level.txt,sha256=Asvruw-SyLoYhWis1CFOx89RGxpjXoTZVGoq4JSGt88,21
|
|
13
|
+
dump_things_pyclient-0.1.4.dist-info/RECORD,,
|
|
File without changes
|
{dump_things_pyclient-0.1.3.dist-info → dump_things_pyclient-0.1.4.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|