ds-caselaw-marklogic-api-client 34.0.2__py3-none-any.whl → 34.1.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.
@@ -9,6 +9,7 @@ from caselawclient.xml_helpers import DEFAULT_NAMESPACES
9
9
 
10
10
  from ..models.documents import Document
11
11
  from ..models.judgments import Judgment
12
+ from ..models.parser_logs import ParserLog
12
13
  from ..models.press_summaries import PressSummary
13
14
 
14
15
 
@@ -140,7 +141,7 @@ def get_document_type_class(xml: bytes) -> type[Document]:
140
141
 
141
142
  # If the document is a parser error with a root element of `error`, it's not of a special type.
142
143
  if node.xpath("/error", namespaces=DEFAULT_NAMESPACES):
143
- return Document
144
+ return ParserLog
144
145
 
145
146
  # Otherwise, we don't know for sure. Fail out.
146
147
  raise CannotDetermineDocumentType(
@@ -0,0 +1,13 @@
1
+ from __future__ import annotations
2
+
3
+ from .documents import Document
4
+
5
+
6
+ class ParserLog(Document):
7
+ """
8
+ A fundamentally different type of Document that is not part of the akomaNtoso spec
9
+ """
10
+
11
+ document_noun = "parser log"
12
+ document_noun_plural = "parser logs"
13
+ type_collection_name = "parser-log"
@@ -161,6 +161,14 @@ class SearchResult:
161
161
  self.node = node
162
162
  self.client = client
163
163
 
164
+ def __repr__(self) -> str:
165
+ try:
166
+ slug = self.slug
167
+ except RuntimeError:
168
+ slug = "**NO SLUG**"
169
+ name = self.name or "**NO NAME**"
170
+ return f"<SearchResult {self.uri} {slug} {name} {self.date}>"
171
+
164
172
  @property
165
173
  def uri(self) -> DocumentURIString:
166
174
  """
@@ -174,7 +182,8 @@ class SearchResult:
174
182
  @property
175
183
  def identifiers(self) -> Identifiers:
176
184
  identifiers_etrees = self._get_xpath(".//identifiers")
177
- if count := len(identifiers_etrees) != 1:
185
+ count = len(identifiers_etrees)
186
+ if count != 1:
178
187
  logging.warning(f"{count} //identifiers nodes found in search result, expected 1.")
179
188
  identifiers_etree = None if not identifiers_etrees else identifiers_etrees[0]
180
189
  return unpack_all_identifiers_from_etree(identifiers_etree)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ds-caselaw-marklogic-api-client
3
- Version: 34.0.2
3
+ Version: 34.1.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,6 +1,6 @@
1
1
  caselawclient/Client.py,sha256=v8Zb7vZmoF3COJWtIzoJxTy8d3DLo-mlNH3MhfDL4hs,44931
2
2
  caselawclient/__init__.py,sha256=DY-caubLDQWWingSdsBWgovDNXh8KcnkI6kwz08eIFk,612
3
- caselawclient/client_helpers/__init__.py,sha256=Qo1bvNz6wq4-d9szsALYWTGrlg5mRyNccUJHOK_dsIM,5009
3
+ caselawclient/client_helpers/__init__.py,sha256=eucyUXwUqI72TPw-C5zLcHlMu4GtFY507a6lQc03lQY,5053
4
4
  caselawclient/client_helpers/search_helpers.py,sha256=R99HyRLeYHgsw2L3DOidEqlKLLvs6Tga5rKTuWQViig,1525
5
5
  caselawclient/content_hash.py,sha256=0cPC4OoABq0SC2wYFX9-24DodNigeOqksDxgxQH_hUA,2221
6
6
  caselawclient/errors.py,sha256=JC16fEGq_MRJX-_KFzfINCV2Cqx8o6OWOt3C16rQd84,3142
@@ -20,6 +20,7 @@ caselawclient/models/identifiers/press_summary_ncn.py,sha256=0SU6WQqj337VOio8pzS
20
20
  caselawclient/models/identifiers/unpacker.py,sha256=xvp480QESbN36NEc6qeo-orqOBq6WchnLI7thY7A1qs,2156
21
21
  caselawclient/models/judgments.py,sha256=r40irgdEID-NeSNLm3OUdUBznMpRSwjD2SJrGlBgP8o,2208
22
22
  caselawclient/models/neutral_citation_mixin.py,sha256=jAac3PPuWyPdj9N-n-U_JfwkbgbSIXaqFVQahfu95do,2086
23
+ caselawclient/models/parser_logs.py,sha256=30kF4w0GcowiMIFtymUkl7ZARanNh_PjDpJZezn-cA8,315
23
24
  caselawclient/models/press_summaries.py,sha256=PIq9RceZ7n7Z079tESfxhQbfxCmtTc2V2OeFtcn594s,2144
24
25
  caselawclient/models/utilities/__init__.py,sha256=u3yIhbTjFQ1JJyAm5wsMEBswWl4t6Z7UMORF5FqC2xQ,1257
25
26
  caselawclient/models/utilities/aws.py,sha256=E4nFcNC2xxPUv0Xkfi2XTO3FyIH6jaAy9pgsvR48Eg8,8759
@@ -28,7 +29,7 @@ caselawclient/models/utilities/move.py,sha256=MXdUqkSiyqRb8YKs_66B6ICWn8EWM6DiJV
28
29
  caselawclient/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
30
  caselawclient/responses/__init__.py,sha256=2-5NJn_PXPTje_W4dHeHYaNRN6vXK4UcB9eLLNUAKa4,67
30
31
  caselawclient/responses/search_response.py,sha256=Z76Zj4VvM-EV_vdiehv2-Jfkr9HZD3SvCTlRrUB_cyE,1951
31
- caselawclient/responses/search_result.py,sha256=KyC8aARlcjllHkH7UzikBrdvreSRfoTJv3rNQqrHkmc,9124
32
+ caselawclient/responses/search_result.py,sha256=sGVIJMLXuN2A2MFPPDoOkXu3SE4wO5IcelLZj4yfWuY,9385
32
33
  caselawclient/responses/xsl/search_match.xsl,sha256=4Sv--MrwBd7J48E9aI7jlFSXGlNi4dBqgzJ3bdMJ_ZU,1018
33
34
  caselawclient/search_parameters.py,sha256=nR-UC1aWZbdXzXBrVDaHECU4Ro8Zi4JZATtgrpAVsKY,3342
34
35
  caselawclient/types.py,sha256=0PsEsQzJOInpuwZ-Ydw0UpGns6jbHzlJhc-Ms28sqCU,2064
@@ -80,7 +81,7 @@ caselawclient/xquery/validate_document.xqy,sha256=PgaDcnqCRJPIVqfmWsNlXmCLNKd21q
80
81
  caselawclient/xquery/xslt.xqy,sha256=w57wNijH3dkwHkpKeAxqjlghVflQwo8cq6jS_sm-erM,199
81
82
  caselawclient/xquery/xslt_transform.xqy,sha256=cccaFiGkCcvSfDv007UriZ3I4ak2nTLP1trRZdbOoS8,2462
82
83
  caselawclient/xquery_type_dicts.py,sha256=21V6PJ0a8lPZuwzQCWeHNo914hdCbCJtOvnqdHcTpKk,6383
83
- ds_caselaw_marklogic_api_client-34.0.2.dist-info/LICENSE.md,sha256=fGMzyyLuQW-IAXUeDSCrRdsYW536aEWThdbpCjo6ZKg,1108
84
- ds_caselaw_marklogic_api_client-34.0.2.dist-info/METADATA,sha256=VyBz-KkHwTTe0Ty6JM_VVMJBI3dstMNCpR-XjhpwvaQ,4206
85
- ds_caselaw_marklogic_api_client-34.0.2.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
86
- ds_caselaw_marklogic_api_client-34.0.2.dist-info/RECORD,,
84
+ ds_caselaw_marklogic_api_client-34.1.0.dist-info/LICENSE.md,sha256=fGMzyyLuQW-IAXUeDSCrRdsYW536aEWThdbpCjo6ZKg,1108
85
+ ds_caselaw_marklogic_api_client-34.1.0.dist-info/METADATA,sha256=0WenWow7mxoo14nUnwyIZAl5Yo0kUlbxCPggUHzzcqo,4206
86
+ ds_caselaw_marklogic_api_client-34.1.0.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
87
+ ds_caselaw_marklogic_api_client-34.1.0.dist-info/RECORD,,