invenio-vocabularies 8.2.0__py2.py3-none-any.whl → 8.3.0__py2.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.

Potentially problematic release.


This version of invenio-vocabularies might be problematic. Click here for more details.

@@ -11,6 +11,6 @@
11
11
 
12
12
  from .ext import InvenioVocabularies
13
13
 
14
- __version__ = "8.2.0"
14
+ __version__ = "8.3.0"
15
15
 
16
16
  __all__ = ("__version__", "InvenioVocabularies")
@@ -10,8 +10,8 @@
10
10
  """ROR-related Datastreams Readers/Writers/Transformers module."""
11
11
 
12
12
  import io
13
+ from datetime import datetime
13
14
 
14
- import arrow
15
15
  import requests
16
16
  from flask import current_app
17
17
  from idutils import normalize_ror
@@ -52,9 +52,11 @@ class RORHTTPReader(BaseReader):
52
52
  json_ld_reponse.raise_for_status()
53
53
  json_ld_data = json_ld_reponse.json()
54
54
 
55
- last_dump_date = arrow.get(
56
- json_ld_data.get("dateCreated")
57
- or json_ld_data.get("datePublished")
55
+ last_dump_date = json_ld_data.get(
56
+ "dateCreated"
57
+ ) or json_ld_data.get("datePublished")
58
+ last_dump_date = datetime.fromisoformat(
59
+ last_dump_date.replace("Z", "+00:00")
58
60
  )
59
61
  return last_dump_date
60
62
  else:
@@ -93,7 +95,9 @@ class RORHTTPReader(BaseReader):
93
95
 
94
96
  if self._since and self._since != "None":
95
97
  last_dump_date = self._get_last_dump_date(linksets)
96
- if last_dump_date < arrow.get(self._since):
98
+ since = datetime.fromisoformat(self._since)
99
+
100
+ if last_dump_date < since:
97
101
  current_app.logger.info(
98
102
  f"Skipping ROR data dump (last dump: {last_dump_date}, since: {self._since})"
99
103
  )
@@ -11,13 +11,12 @@
11
11
  import csv
12
12
  import io
13
13
  import tarfile
14
- from concurrent.futures import ThreadPoolExecutor, as_completed
14
+ from concurrent.futures import ThreadPoolExecutor
15
15
  from contextvars import copy_context
16
- from datetime import timedelta
16
+ from datetime import datetime, timedelta
17
17
  from itertools import islice
18
18
  from pathlib import Path
19
19
 
20
- import arrow
21
20
  import regex as re
22
21
  from flask import current_app
23
22
  from invenio_access.permissions import system_identity
@@ -66,12 +65,16 @@ class OrcidDataSyncReader(BaseReader):
66
65
 
67
66
  Yield ORCiDs to sync until the last sync date is reached.
68
67
  """
69
- date_format = "YYYY-MM-DD HH:mm:ss.SSSSSS"
70
- date_format_no_millis = "YYYY-MM-DD HH:mm:ss"
71
- time_shift = current_app.config["VOCABULARIES_ORCID_SYNC_SINCE"]
68
+ date_format = "%Y-%m-%d %H:%M:%S.%f"
69
+ date_format_no_millis = "%Y-%m-%d %H:%M:%S"
70
+
72
71
  if self.since:
73
- time_shift = self.since
74
- last_sync = arrow.now() - timedelta(**time_shift)
72
+ last_sync = datetime.now()
73
+ else:
74
+ last_sync = datetime.now() - timedelta(
75
+ **current_app.config["VOCABULARIES_ORCID_SYNC_SINCE"]
76
+ )
77
+
75
78
  try:
76
79
  content = io.TextIOWrapper(fileobj, encoding="utf-8")
77
80
  csv_reader = csv.DictReader(content)
@@ -82,9 +85,11 @@ class OrcidDataSyncReader(BaseReader):
82
85
  # Lambda file is ordered by last modified date
83
86
  last_modified_str = row["last_modified"]
84
87
  try:
85
- last_modified_date = arrow.get(last_modified_str, date_format)
86
- except arrow.parser.ParserError:
87
- last_modified_date = arrow.get(
88
+ last_modified_date = datetime.strptime(
89
+ last_modified_str, date_format
90
+ )
91
+ except Exception:
92
+ last_modified_date = datetime.strptime(
88
93
  last_modified_str, date_format_no_millis
89
94
  )
90
95
 
@@ -45,8 +45,10 @@ class SubjectsSearchOptions(SearchOptions):
45
45
  """Search options."""
46
46
 
47
47
  suggest_parser_cls = CompositeSuggestQueryParser.factory(
48
+ filter_field="scheme",
48
49
  fields=[
49
50
  "subject^100",
51
+ "scheme^20",
50
52
  localized_title,
51
53
  "synonyms^20",
52
54
  ],
@@ -8,8 +8,6 @@
8
8
 
9
9
  """Jobs module."""
10
10
 
11
- import datetime
12
-
13
11
  from invenio_i18n import lazy_gettext as _
14
12
  from invenio_jobs.jobs import JobType
15
13
 
@@ -40,7 +38,7 @@ class ProcessRORAffiliationsJob(ProcessDataStreamJob):
40
38
  "config": {
41
39
  "readers": [
42
40
  {
43
- "args": {"since": str(since)},
41
+ "args": {"since": since},
44
42
  "type": "ror-http",
45
43
  },
46
44
  {"args": {"regex": "_schema_v2\\.json$"}, "type": "zip"},
@@ -78,7 +76,7 @@ class ProcessRORFundersJob(ProcessDataStreamJob):
78
76
  "config": {
79
77
  "readers": [
80
78
  {
81
- "args": {"since": str(since)},
79
+ "args": {"since": since},
82
80
  "type": "ror-http",
83
81
  },
84
82
  {"args": {"regex": "_schema_v2\\.json$"}, "type": "zip"},
@@ -173,4 +171,9 @@ class ImportORCIDJob(ProcessDataStreamJob):
173
171
  @classmethod
174
172
  def build_task_arguments(cls, job_obj, since=None, **kwargs):
175
173
  """Process ORCID data."""
176
- return {"config": {**ORCID_PRESET_DATASTREAM_CONFIG}}
174
+ task_args = {"config": {**ORCID_PRESET_DATASTREAM_CONFIG}}
175
+ for reader in task_args["config"]["readers"]:
176
+ # Assign since to all readers of the ORCID job
177
+ # It is the responsibility of the reader to handle it or ignore it
178
+ reader["args"] = {**reader.get("args", {}), "since": str(since)}
179
+ return task_args
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: invenio-vocabularies
3
- Version: 8.2.0
3
+ Version: 8.3.0
4
4
  Summary: Invenio module for managing vocabularies.
5
5
  Home-page: https://github.com/inveniosoftware/invenio-vocabularies
6
6
  Author: CERN
@@ -89,6 +89,14 @@ Invenio module for managing vocabularies, based on Invenio-Records and Invenio-R
89
89
  Changes
90
90
  =======
91
91
 
92
+ Version v8.3.0 (released 2025-07-31)
93
+
94
+ - subjects: Add search scheme field configuration to enable composite and filter query support in subject search functionality
95
+
96
+ Version v8.2.1 (released 2025-07-21)
97
+
98
+ - fix(jobs): remove string casts from since
99
+
92
100
  Version v8.2.0 (released 2025-07-17)
93
101
 
94
102
  - tasks: fix error name
@@ -1,10 +1,10 @@
1
- invenio_vocabularies/__init__.py,sha256=HoDbpyP1QLhDVWx9AXCeUASOwbeWCvmIXCokn6cwpNE,434
1
+ invenio_vocabularies/__init__.py,sha256=XqkbqtX6LzTtz60HTCIzX0QkWYmN5Aiagh22cYaT3EM,434
2
2
  invenio_vocabularies/cli.py,sha256=CpXTTIn2GTpUqNfLEMlRAp3JWst8ZjHVxoGYdhuuv_4,5959
3
3
  invenio_vocabularies/config.py,sha256=v6fTdeQXfUl0LavI2Xslql7mv3DVuIuGTqe2z3H3S7o,6942
4
4
  invenio_vocabularies/ext.py,sha256=GujJ4UARd4Fxf4z7zznRk9JAgHamZuYCOdrKU5czg00,5987
5
5
  invenio_vocabularies/factories.py,sha256=DM4jRUYu-so1jHRzhbNoNTnWKpYTZeRJhSP273giYws,6400
6
6
  invenio_vocabularies/fixtures.py,sha256=iEPkWf_ZjdP2D9r2sLdIlPoR8Rq2m5cnoFwywUGHneg,1696
7
- invenio_vocabularies/jobs.py,sha256=ACNpTRoM8AcSlkU79spEKOe8LHtRuBOBLNZQK2jSCgc,5811
7
+ invenio_vocabularies/jobs.py,sha256=fSRedZhu_jH5gBD7Z8f_sNdGxAn9dFmbouXkIbqE4LI,6083
8
8
  invenio_vocabularies/proxies.py,sha256=k7cTUgWfnCoYIuNqAj_VFi1zBN33KNNclRSVnBkObEM,711
9
9
  invenio_vocabularies/views.py,sha256=PNJ5nvc3O7ASwNe56xmqy5YaU9n3UYF3W2JwvtE_kYs,1561
10
10
  invenio_vocabularies/webpack.py,sha256=FkM8TxXClmaJcD8YsQq5Mai56nYVJh_1IYTMEHb3c1M,1891
@@ -148,7 +148,7 @@ invenio_vocabularies/contrib/common/__init__.py,sha256=DdbGYRthEpQtObhY_YK4vOT9Z
148
148
  invenio_vocabularies/contrib/common/openaire/__init__.py,sha256=L7UtSimFJ3NI6j53bHzYKsWpFti1uo4fPb9OaTl7leI,244
149
149
  invenio_vocabularies/contrib/common/openaire/datastreams.py,sha256=BV6NtBCPFuii6KbTHGkgNQO5tt_3Hn9T_219bz8AINg,3514
150
150
  invenio_vocabularies/contrib/common/ror/__init__.py,sha256=3u2-fre1SQ-4nz3Ay0nxj3ntmMZ8Ujh_4eV-fyxfmtc,239
151
- invenio_vocabularies/contrib/common/ror/datastreams.py,sha256=V2GzJ2Hsu7QFcbqguEE2Z8X5ZDiqRp5Q0e-o1x0BmdQ,8434
151
+ invenio_vocabularies/contrib/common/ror/datastreams.py,sha256=8rxfWDMZPIkkPJM5Z3GGQcuDfZI9_hjYwn_-ngMDx_k,8601
152
152
  invenio_vocabularies/contrib/funders/__init__.py,sha256=YxFXBDnT7NM8rFwxT_Ge3xXR2n17EM0alknQq7r_Bt8,478
153
153
  invenio_vocabularies/contrib/funders/api.py,sha256=QKGGeSnPHSoBfucvpaVruXT_txYidofZ080G3IxFkIo,306
154
154
  invenio_vocabularies/contrib/funders/config.py,sha256=OAP7NB7oF3cmrLBlP9dubrAAtanPWvrQO1XZaImBf98,2242
@@ -175,7 +175,7 @@ invenio_vocabularies/contrib/names/__init__.py,sha256=QwPEMnNyjt9LVeBBdFbVQfIxOn
175
175
  invenio_vocabularies/contrib/names/api.py,sha256=sEPn_jFX3gyoxgbdEUSIvOoPCUI8pocI6qCZO6mzCgQ,300
176
176
  invenio_vocabularies/contrib/names/components.py,sha256=PyYD1lOhmsuNoyDwM_huxkeo7kWd44vkEbJk9gqbDrM,769
177
177
  invenio_vocabularies/contrib/names/config.py,sha256=62jh4MP-CygnBpnRBVaCoGySHDEwhBSG1MnlUBumthw,2046
178
- invenio_vocabularies/contrib/names/datastreams.py,sha256=ZbgJo0q76ZEIRp8IQ2Qzj16IWoc1TWXoBmfjNUaT06E,16887
178
+ invenio_vocabularies/contrib/names/datastreams.py,sha256=FqljkIl_MdYQ-oAnSMFf2Smfz-XjX8eVIdngeQApey0,16933
179
179
  invenio_vocabularies/contrib/names/models.py,sha256=SYdtDDG-y5Wq_d06YhiVO5n8gfxPW_mx-tECsIcv5H8,308
180
180
  invenio_vocabularies/contrib/names/names.py,sha256=jej3gkBgOJpKwp5RmWk1AP678WkMb0VqCpzbTHLTyEc,2675
181
181
  invenio_vocabularies/contrib/names/permissions.py,sha256=5xrpYsA3oQUJ5lJpF7wjRAFiW-pM6_yP1k9zllbRwnQ,844
@@ -196,7 +196,7 @@ invenio_vocabularies/contrib/names/mappings/v7/__init__.py,sha256=qLGB8C0kPI3xub
196
196
  invenio_vocabularies/contrib/names/mappings/v7/names/name-v1.0.0.json,sha256=5Ybcq3fUMYx3u1MNKmHh-CWBtATS9MYpdEcwAM8EQ80,1943
197
197
  invenio_vocabularies/contrib/subjects/__init__.py,sha256=GtXZKA6VWG1oA1fUX2Wh92nd-1i7RnnQF6RprGhxkD4,591
198
198
  invenio_vocabularies/contrib/subjects/api.py,sha256=QH8mxoLsa8qjJT1i1Tj6rRnpbH23plo2IMOJ56rnvbU,347
199
- invenio_vocabularies/contrib/subjects/config.py,sha256=CLQT1_5gj4waCFBI6K2jobHHUQjW0RJ7Xk49caWDP14,2378
199
+ invenio_vocabularies/contrib/subjects/config.py,sha256=8_5FKfG5x5xIxw7eqwZNnanjJSH43EDTiaRKVOjatvk,2434
200
200
  invenio_vocabularies/contrib/subjects/datastreams.py,sha256=s6o5_A-0I3TMx77IbwmLHJpSuDWx8xClW9ocnP2JYfw,1885
201
201
  invenio_vocabularies/contrib/subjects/facets.py,sha256=qQ7_rppFBzsmrlZu4-MvOIdUcjeOmDA9gOHAcs0lWwI,695
202
202
  invenio_vocabularies/contrib/subjects/models.py,sha256=8XgbVRxDDvhWPjMWsoCriNlOKdmV_113a14yLRtlvM4,363
@@ -328,10 +328,10 @@ invenio_vocabularies/translations/zh_CN/LC_MESSAGES/messages.mo,sha256=AEoPrwqBX
328
328
  invenio_vocabularies/translations/zh_CN/LC_MESSAGES/messages.po,sha256=sP0-MvZo4F4wIG4JVLebCAOxh1tFIkfM2bLaKL-B148,8024
329
329
  invenio_vocabularies/translations/zh_TW/LC_MESSAGES/messages.mo,sha256=p2PFN_PL1m7miZ6qyoHFmBi6UUF3qhuz1sfCqTxm5fY,599
330
330
  invenio_vocabularies/translations/zh_TW/LC_MESSAGES/messages.po,sha256=vO8YRTkTqKE6gepSW_N3uNKYp3Me1rqnYaONFQGJOoY,7519
331
- invenio_vocabularies-8.2.0.dist-info/licenses/AUTHORS.rst,sha256=8d0p_WWE1r9DavvzMDi2D4YIGBHiMYcN3LYxqQOj8sY,291
332
- invenio_vocabularies-8.2.0.dist-info/licenses/LICENSE,sha256=UvI8pR8jGWqe0sTkb_hRG6eIrozzWwWzyCGEpuXX4KE,1062
333
- invenio_vocabularies-8.2.0.dist-info/METADATA,sha256=DUcvbypazoDpoVyHCEwPsw06BM7dSGSfnc6k5d2J-4E,14848
334
- invenio_vocabularies-8.2.0.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
335
- invenio_vocabularies-8.2.0.dist-info/entry_points.txt,sha256=lget4Ekno9VRTq36oowWReIJA99165gOp0BOiiET60Y,3179
336
- invenio_vocabularies-8.2.0.dist-info/top_level.txt,sha256=x1gRNbaODF_bCD0SBLM3nVOFPGi06cmGX5X94WKrFKk,21
337
- invenio_vocabularies-8.2.0.dist-info/RECORD,,
331
+ invenio_vocabularies-8.3.0.dist-info/licenses/AUTHORS.rst,sha256=8d0p_WWE1r9DavvzMDi2D4YIGBHiMYcN3LYxqQOj8sY,291
332
+ invenio_vocabularies-8.3.0.dist-info/licenses/LICENSE,sha256=UvI8pR8jGWqe0sTkb_hRG6eIrozzWwWzyCGEpuXX4KE,1062
333
+ invenio_vocabularies-8.3.0.dist-info/METADATA,sha256=Dlo1Et4okP8_1TBa4zoID2kIjFfnRytFIyd3c9bRZ2M,15097
334
+ invenio_vocabularies-8.3.0.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
335
+ invenio_vocabularies-8.3.0.dist-info/entry_points.txt,sha256=lget4Ekno9VRTq36oowWReIJA99165gOp0BOiiET60Y,3179
336
+ invenio_vocabularies-8.3.0.dist-info/top_level.txt,sha256=x1gRNbaODF_bCD0SBLM3nVOFPGi06cmGX5X94WKrFKk,21
337
+ invenio_vocabularies-8.3.0.dist-info/RECORD,,