ds-caselaw-marklogic-api-client 27.2.0__py3-none-any.whl → 27.3.0__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.
caselawclient/Client.py CHANGED
@@ -217,10 +217,10 @@ class MarklogicApiClient:
217
217
  def get_document_by_uri(
218
218
  self,
219
219
  uri: DocumentURIString,
220
- query: Optional[str] = None,
220
+ search_query: Optional[str] = None,
221
221
  ) -> Document:
222
222
  document_type_class = self.get_document_type_from_uri(uri)
223
- return document_type_class(uri, self)
223
+ return document_type_class(uri, self, search_query=search_query)
224
224
 
225
225
  def get_document_type_from_uri(self, uri: DocumentURIString) -> Type[Document]:
226
226
  vars: query_dicts.DocumentCollectionsDict = {
@@ -1080,6 +1080,7 @@ class MarklogicApiClient:
1080
1080
  self,
1081
1081
  target_enrichment_version: tuple[int, int],
1082
1082
  target_parser_version: tuple[int, int],
1083
+ maximum_records: int = 1000,
1083
1084
  ) -> list[list[Any]]:
1084
1085
  """Retrieve documents which are not yet enriched with a given version."""
1085
1086
  vars: query_dicts.GetPendingEnrichmentForVersionDict = {
@@ -1087,6 +1088,7 @@ class MarklogicApiClient:
1087
1088
  "target_enrichment_minor_version": target_enrichment_version[1],
1088
1089
  "target_parser_major_version": target_parser_version[0],
1089
1090
  "target_parser_minor_version": target_parser_version[1],
1091
+ "maximum_records": maximum_records,
1090
1092
  }
1091
1093
  results: list[list[Any]] = json.loads(
1092
1094
  get_single_string_from_marklogic_response(
@@ -1115,11 +1117,13 @@ class MarklogicApiClient:
1115
1117
  def get_pending_parse_for_version(
1116
1118
  self,
1117
1119
  target_version: tuple[int, int],
1120
+ maximum_records: int = 1000,
1118
1121
  ) -> list[list[Any]]:
1119
1122
  """Retrieve documents which are not yet parsed with a given version."""
1120
1123
  vars: query_dicts.GetPendingParseForVersionDict = {
1121
1124
  "target_major_version": target_version[0],
1122
1125
  "target_minor_version": target_version[1],
1126
+ "maximum_records": maximum_records,
1123
1127
  }
1124
1128
  results: list[list[Any]] = json.loads(
1125
1129
  get_single_string_from_marklogic_response(
@@ -1,9 +1,11 @@
1
1
  xquery version "1.0-ml";
2
2
 
3
+ declare namespace xdmp="http://marklogic.com/xdmp";
3
4
  declare variable $target_enrichment_major_version as xs:int external;
4
5
  declare variable $target_enrichment_minor_version as xs:int external;
5
6
  declare variable $target_parser_major_version as xs:int external;
6
7
  declare variable $target_parser_minor_version as xs:int external;
8
+ declare variable $maximum_records as xs:int? external := 1000;
7
9
 
8
10
  xdmp:to-json(xdmp:sql(
9
11
  "SELECT process_data.uri, enrich_version_string, minutes_since_enrichment_request
@@ -23,13 +25,16 @@ xdmp:to-json(xdmp:sql(
23
25
  (parser_major_version = @target_parser_major_version AND parser_minor_version = @target_parser_minor_version)
24
26
  )
25
27
  AND (minutes_since_enrichment_request > 43200 OR minutes_since_enrichment_request IS NULL)
26
- ORDER BY enrich_major_version ASC NULLS FIRST, enrich_minor_version ASC",
28
+ ORDER BY enrich_major_version ASC NULLS FIRST, enrich_minor_version ASC
29
+ LIMIT @maximum_records",
27
30
  "array",
28
31
  map:new((
29
32
  map:entry("target_enrichment_major_version", $target_enrichment_major_version),
30
33
  map:entry("target_enrichment_minor_version", $target_enrichment_minor_version),
31
34
  map:entry("target_parser_major_version", $target_parser_major_version),
32
- map:entry("target_parser_minor_version", $target_parser_minor_version)
35
+ map:entry("target_parser_minor_version", $target_parser_minor_version),
36
+ map:entry("maximum_records", $maximum_records)
37
+
33
38
  ))
34
39
  ))
35
40
 
@@ -2,6 +2,7 @@ xquery version "1.0-ml";
2
2
 
3
3
  declare variable $target_major_version as xs:int external;
4
4
  declare variable $target_minor_version as xs:int external;
5
+ declare variable $maximum_records as xs:int? external := 1000;
5
6
 
6
7
  xdmp:to-json(xdmp:sql(
7
8
  "SELECT process_data.uri, parser_version_string, minutes_since_parse_request
@@ -18,11 +19,13 @@ xdmp:to-json(xdmp:sql(
18
19
  (parser_major_version <= @target_major_version AND parser_minor_version < @target_minor_version)
19
20
  )
20
21
  AND (minutes_since_parse_request > 43200 OR minutes_since_parse_request IS NULL)
21
- ORDER BY parser_major_version ASC NULLS FIRST, parser_minor_version ASC",
22
+ ORDER BY parser_major_version ASC NULLS FIRST, parser_minor_version ASC
23
+ LIMIT @maximum_records",
22
24
  "array",
23
25
  map:new((
24
26
  map:entry("target_major_version", $target_major_version),
25
- map:entry("target_minor_version", $target_minor_version)
27
+ map:entry("target_minor_version", $target_minor_version),
28
+ map:entry("maximum_records", $maximum_records)
29
+
26
30
  ))
27
- ))
28
-
31
+ ))
@@ -88,6 +88,7 @@ class GetLastModifiedDict(MarkLogicAPIDict):
88
88
 
89
89
  # get_pending_enrichment_for_version.xqy
90
90
  class GetPendingEnrichmentForVersionDict(MarkLogicAPIDict):
91
+ maximum_records: Optional[int]
91
92
  target_enrichment_major_version: int
92
93
  target_enrichment_minor_version: int
93
94
  target_parser_major_version: int
@@ -96,6 +97,7 @@ class GetPendingEnrichmentForVersionDict(MarkLogicAPIDict):
96
97
 
97
98
  # get_pending_parse_for_version.xqy
98
99
  class GetPendingParseForVersionDict(MarkLogicAPIDict):
100
+ maximum_records: Optional[int]
99
101
  target_major_version: int
100
102
  target_minor_version: int
101
103
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ds-caselaw-marklogic-api-client
3
- Version: 27.2.0
3
+ Version: 27.3.0
4
4
  Summary: An API client for interacting with the underlying data in Find Caselaw.
5
5
  Home-page: https://github.com/nationalarchives/ds-caselaw-custom-api-client
6
6
  Keywords: national archives,caselaw
@@ -1,4 +1,4 @@
1
- caselawclient/Client.py,sha256=WKDQaN4b3J3m2pzYdvK4t1MmbeVS9pbtTfqcEH1K-RU,40464
1
+ caselawclient/Client.py,sha256=oMWfL0FwKdWyMtk_0qf6uxWJvsHLSps8vxDsAC9GxeI,40668
2
2
  caselawclient/__init__.py,sha256=DY-caubLDQWWingSdsBWgovDNXh8KcnkI6kwz08eIFk,612
3
3
  caselawclient/client_helpers/__init__.py,sha256=fyDNKCdrTb2N0Ks23YDhmvlXKfLTHnYQCXhnZb-QQbg,3832
4
4
  caselawclient/client_helpers/search_helpers.py,sha256=R99HyRLeYHgsw2L3DOidEqlKLLvs6Tga5rKTuWQViig,1525
@@ -41,8 +41,8 @@ caselawclient/xquery/get_judgment.xqy,sha256=8V-sEFKmtpf2LIZD9QKVRfpblEsmDpP4BA6
41
41
  caselawclient/xquery/get_judgment_checkout_status.xqy,sha256=mdY9UXLyzQdB7byEERPqentlr0YDLbXRVqH0h4UuZTQ,193
42
42
  caselawclient/xquery/get_judgment_version.xqy,sha256=wF9k9-CBrqo8VbxxyTrD-AGzR3-3jMm25tRVCjxPLrU,292
43
43
  caselawclient/xquery/get_last_modified.xqy,sha256=8fCm_7o_kkytCEmEeSTLWzLP7iOjuPV01IfHDgf6HaQ,172
44
- caselawclient/xquery/get_pending_enrichment_for_version.xqy,sha256=jYc2OPnAIU4kfRsyhCam9RtrxOB2KhKX40CALFc2Rwo,1623
45
- caselawclient/xquery/get_pending_parse_for_version.xqy,sha256=1HRQ3Mwljgp1QbVTiesJrV5HuuMCyKPDMzBOzrT_oQM,1054
44
+ caselawclient/xquery/get_pending_enrichment_for_version.xqy,sha256=S5r5h1iyn_wDQXLEh2MzK8qQ1Jiq-1lRsKgDa8L16yY,1821
45
+ caselawclient/xquery/get_pending_parse_for_version.xqy,sha256=9cjVZtHeBBjm-a7RMsn1PVJt_Ug78YFlmp5CN8VJ1jQ,1197
46
46
  caselawclient/xquery/get_properties_for_search_results.xqy,sha256=Tlv3EKwVV_q-JyQyhjWVHIleicPDpucxP4ScuQjpgSw,625
47
47
  caselawclient/xquery/get_property.xqy,sha256=RHlOTrK0aH-S7s_ykYzGmUeKOJxXlI4vE5sKRt556NY,209
48
48
  caselawclient/xquery/get_version_annotation.xqy,sha256=pFDMGA9SxI59iUPaoAeUsq23kUp4Op7cUg-PFNFqxcI,262
@@ -65,8 +65,8 @@ caselawclient/xquery/validate_all_documents.xqy,sha256=z_0YEXmRcZ-FaJM0ouKiTjdI4
65
65
  caselawclient/xquery/validate_document.xqy,sha256=PgaDcnqCRJPIVqfmWsNlXmCLNKd21qkJrvY1RtNP7eA,140
66
66
  caselawclient/xquery/xslt.xqy,sha256=w57wNijH3dkwHkpKeAxqjlghVflQwo8cq6jS_sm-erM,199
67
67
  caselawclient/xquery/xslt_transform.xqy,sha256=smyFFxqmtkuOzBd2l7uw6K2oAsYctudrP8omdv_XNAM,2463
68
- caselawclient/xquery_type_dicts.py,sha256=papUzI0k_8l987IpBXwACpnlL4GU1UX1cLt83HpAgds,5622
69
- ds_caselaw_marklogic_api_client-27.2.0.dist-info/LICENSE.md,sha256=fGMzyyLuQW-IAXUeDSCrRdsYW536aEWThdbpCjo6ZKg,1108
70
- ds_caselaw_marklogic_api_client-27.2.0.dist-info/METADATA,sha256=Aoc0502BWIboWQBs72vD4FHlRAqBZ-V3jVlRn51zO64,4232
71
- ds_caselaw_marklogic_api_client-27.2.0.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
72
- ds_caselaw_marklogic_api_client-27.2.0.dist-info/RECORD,,
68
+ caselawclient/xquery_type_dicts.py,sha256=AUEmycChASKl8sbqVQWe6WA0s-lIfEqh9mA-GdnUCQ8,5692
69
+ ds_caselaw_marklogic_api_client-27.3.0.dist-info/LICENSE.md,sha256=fGMzyyLuQW-IAXUeDSCrRdsYW536aEWThdbpCjo6ZKg,1108
70
+ ds_caselaw_marklogic_api_client-27.3.0.dist-info/METADATA,sha256=GltSiGOxA1e5fTsNbAdFhCjVwxQe7XAWS__-eZ165AM,4232
71
+ ds_caselaw_marklogic_api_client-27.3.0.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
72
+ ds_caselaw_marklogic_api_client-27.3.0.dist-info/RECORD,,