ds-caselaw-marklogic-api-client 29.0.1__py3-none-any.whl → 29.1.1__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 ds-caselaw-marklogic-api-client might be problematic. Click here for more details.
- caselawclient/errors.py +1 -3
- caselawclient/models/documents/body.py +1 -2
- caselawclient/models/identifiers/__init__.py +3 -0
- caselawclient/models/identifiers/press_summary_ncn.py +20 -0
- caselawclient/models/utilities/aws.py +2 -4
- caselawclient/xquery/get_judgment.xqy +5 -2
- {ds_caselaw_marklogic_api_client-29.0.1.dist-info → ds_caselaw_marklogic_api_client-29.1.1.dist-info}/METADATA +2 -2
- {ds_caselaw_marklogic_api_client-29.0.1.dist-info → ds_caselaw_marklogic_api_client-29.1.1.dist-info}/RECORD +10 -9
- {ds_caselaw_marklogic_api_client-29.0.1.dist-info → ds_caselaw_marklogic_api_client-29.1.1.dist-info}/LICENSE.md +0 -0
- {ds_caselaw_marklogic_api_client-29.0.1.dist-info → ds_caselaw_marklogic_api_client-29.1.1.dist-info}/WHEEL +0 -0
caselawclient/errors.py
CHANGED
|
@@ -37,9 +37,7 @@ class MarklogicResourceUnmanagedError(MarklogicAPIError):
|
|
|
37
37
|
|
|
38
38
|
status_code = 404
|
|
39
39
|
default_message = (
|
|
40
|
-
"The resource isn't managed. "
|
|
41
|
-
"It probably doesn't exist, and if it does, that's a problem. "
|
|
42
|
-
"Please report it."
|
|
40
|
+
"The resource isn't managed. It probably doesn't exist, and if it does, that's a problem. Please report it."
|
|
43
41
|
)
|
|
44
42
|
|
|
45
43
|
|
|
@@ -91,8 +91,7 @@ class DocumentBody:
|
|
|
91
91
|
) -> list[datetime.datetime]:
|
|
92
92
|
name_filter = f"[@name='{name}']" if name else ""
|
|
93
93
|
iso_datetimes = self._xml.get_xpath_match_strings(
|
|
94
|
-
"/akn:akomaNtoso/akn:*/akn:meta/akn:identification/akn:FRBRManifestation"
|
|
95
|
-
f"/akn:FRBRdate{name_filter}/@date",
|
|
94
|
+
f"/akn:akomaNtoso/akn:*/akn:meta/akn:identification/akn:FRBRManifestation/akn:FRBRdate{name_filter}/@date",
|
|
96
95
|
{"akn": "http://docs.oasis-open.org/legaldocml/ns/akn/3.0"},
|
|
97
96
|
)
|
|
98
97
|
|
|
@@ -83,6 +83,9 @@ class Identifier(ABC):
|
|
|
83
83
|
def __repr__(self) -> str:
|
|
84
84
|
return f"<{self.schema.name} {self.value}: {self.uuid}>"
|
|
85
85
|
|
|
86
|
+
def __str__(self) -> str:
|
|
87
|
+
return self.value
|
|
88
|
+
|
|
86
89
|
def __init__(self, value: str, uuid: Optional[str] = None) -> None:
|
|
87
90
|
self.value = value
|
|
88
91
|
if uuid:
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from .neutral_citation import NeutralCitationNumber, NeutralCitationNumberSchema
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class PressSummaryRelatedNCNIdentifierSchema(NeutralCitationNumberSchema):
|
|
5
|
+
"""
|
|
6
|
+
Identifier schema for relating a Press Summary to a Judgment with a given NCN
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
name = "Press Summary relates to NCN"
|
|
10
|
+
namespace = "uksummaryofncn"
|
|
11
|
+
human_readable = True
|
|
12
|
+
base_score_multiplier = 0.5
|
|
13
|
+
|
|
14
|
+
@classmethod
|
|
15
|
+
def compile_identifier_url_slug(cls, value: str) -> str:
|
|
16
|
+
return super().compile_identifier_url_slug(value) + "/press-summary"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class PressSummaryRelatedNCNIdentifier(NeutralCitationNumber):
|
|
20
|
+
schema = NeutralCitationNumberSchema
|
|
@@ -95,7 +95,7 @@ def check_docx_exists(uri: str) -> bool:
|
|
|
95
95
|
|
|
96
96
|
def generate_docx_key(uri: str) -> str:
|
|
97
97
|
"""from a canonical caselaw URI (eat/2022/1) return the S3 key of the associated docx"""
|
|
98
|
-
return f
|
|
98
|
+
return f"{uri}/{uri.replace('/', '_')}.docx"
|
|
99
99
|
|
|
100
100
|
|
|
101
101
|
def generate_docx_url(uri: str) -> str:
|
|
@@ -104,7 +104,7 @@ def generate_docx_url(uri: str) -> str:
|
|
|
104
104
|
|
|
105
105
|
|
|
106
106
|
def generate_pdf_url(uri: str) -> str:
|
|
107
|
-
key = f
|
|
107
|
+
key = f"{uri}/{uri.replace('/', '_')}.pdf"
|
|
108
108
|
|
|
109
109
|
return generate_signed_asset_url(key)
|
|
110
110
|
|
|
@@ -251,8 +251,6 @@ def request_parse(
|
|
|
251
251
|
},
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
-
# breakpoint()
|
|
255
|
-
|
|
256
254
|
client.publish(
|
|
257
255
|
TopicArn=env("REPARSE_SNS_TOPIC"),
|
|
258
256
|
Message=json.dumps(message_to_send),
|
|
@@ -14,6 +14,7 @@ declare variable $search_query as xs:string? external;
|
|
|
14
14
|
let $number_marks_xslt := (
|
|
15
15
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
16
16
|
xmlns:uk="https://caselaw.nationalarchives.gov.uk/akn"
|
|
17
|
+
xmlns:akn="http://docs.oasis-open.org/legaldocml/ns/akn/3.0"
|
|
17
18
|
version="2.0">
|
|
18
19
|
<xsl:output method="xml" />
|
|
19
20
|
<xsl:template match="@*|node()">
|
|
@@ -21,12 +22,15 @@ let $number_marks_xslt := (
|
|
|
21
22
|
<xsl:apply-templates select="@*|node()"/>
|
|
22
23
|
</xsl:copy>
|
|
23
24
|
</xsl:template>
|
|
25
|
+
<xsl:template match="//akn:meta//uk:mark">
|
|
26
|
+
<xsl:apply-templates />
|
|
27
|
+
</xsl:template>
|
|
24
28
|
<xsl:template match="uk:mark">
|
|
25
29
|
<xsl:copy>
|
|
26
30
|
<xsl:copy-of select="@*" />
|
|
27
31
|
<xsl:attribute name="id">
|
|
28
32
|
<xsl:text>mark_</xsl:text>
|
|
29
|
-
<xsl:
|
|
33
|
+
<xsl:number count="//uk:mark" level="any" from="//*[ancestor::akn:meta]" />
|
|
30
34
|
</xsl:attribute>
|
|
31
35
|
<xsl:apply-templates />
|
|
32
36
|
</xsl:copy>
|
|
@@ -62,5 +66,4 @@ let $transformed := if($search_query) then
|
|
|
62
66
|
else
|
|
63
67
|
$raw_xml
|
|
64
68
|
|
|
65
|
-
|
|
66
69
|
return $transformed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ds-caselaw-marklogic-api-client
|
|
3
|
-
Version: 29.
|
|
3
|
+
Version: 29.1.1
|
|
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
|
|
@@ -13,7 +13,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
13
13
|
Requires-Dist: boto3 (>=1.26.112,<2.0.0)
|
|
14
14
|
Requires-Dist: certifi (>=2024.12.14,<2024.13.0)
|
|
15
15
|
Requires-Dist: charset-normalizer (>=3.0.0,<4.0.0)
|
|
16
|
-
Requires-Dist: django-environ (>=0.
|
|
16
|
+
Requires-Dist: django-environ (>=0.12.0)
|
|
17
17
|
Requires-Dist: ds-caselaw-utils (>=2.0.0,<3.0.0)
|
|
18
18
|
Requires-Dist: idna (>=3.4,<4.0)
|
|
19
19
|
Requires-Dist: lxml (>=5.0.0,<6.0.0)
|
|
@@ -3,25 +3,26 @@ 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
|
|
5
5
|
caselawclient/content_hash.py,sha256=0cPC4OoABq0SC2wYFX9-24DodNigeOqksDxgxQH_hUA,2221
|
|
6
|
-
caselawclient/errors.py,sha256=
|
|
6
|
+
caselawclient/errors.py,sha256=JC16fEGq_MRJX-_KFzfINCV2Cqx8o6OWOt3C16rQd84,3142
|
|
7
7
|
caselawclient/factories.py,sha256=6-xZMVmvtXA8AnyWJgJTums1EWfM6lPIhrWQu0NopJo,4472
|
|
8
8
|
caselawclient/identifier_resolution.py,sha256=IOqrZcIHoHhNOCAkNveOBcWddBNpkOB8cz1r0zFa8mQ,1829
|
|
9
9
|
caselawclient/models/__init__.py,sha256=kd23EUpvaC7aLHdgk8farqKAQEx3lf7RvNT2jEatvlg,68
|
|
10
10
|
caselawclient/models/documents/__init__.py,sha256=Lzb18MyCPLlG0Y4EdnjZvnGFSSpsNs_BUgJA6BQqL28,19520
|
|
11
|
-
caselawclient/models/documents/body.py,sha256=
|
|
11
|
+
caselawclient/models/documents/body.py,sha256=7Sj6lnddcAM8VAeecAS2VEhQHR9CB3G0fL8TAXz7EXw,5588
|
|
12
12
|
caselawclient/models/documents/exceptions.py,sha256=rw1xId16vBKvBImgFmFUpeFgKqU7VTNtVLIEVBPGKyk,374
|
|
13
13
|
caselawclient/models/documents/statuses.py,sha256=Cp4dTQmJOtsU41EJcxy5dV1841pGD2PNWH0VrkDEv4Q,579
|
|
14
14
|
caselawclient/models/documents/transforms/html.xsl,sha256=oSSO-IBX4qLiSWexQYmWJfGNevF09aCBx4D1NYqXxpo,38322
|
|
15
15
|
caselawclient/models/documents/xml.py,sha256=HlmPb63lLMnySSOLP4iexcAyQiLByKBZtTd25f8sY8M,1268
|
|
16
|
-
caselawclient/models/identifiers/__init__.py,sha256=
|
|
16
|
+
caselawclient/models/identifiers/__init__.py,sha256=mi7PGHYtezZx7HjpIPpBn58Ugs7XMY7jFeAnkYtxsic,6521
|
|
17
17
|
caselawclient/models/identifiers/fclid.py,sha256=pTO586ra0sr4DbjHSxuI8UlxfNXLm9nDNVoDUIxiUrE,1354
|
|
18
18
|
caselawclient/models/identifiers/neutral_citation.py,sha256=3Jw1_-NmGfGmrWGFSzLdTHBYHIHq4tPkF8U7Jba-jGo,1848
|
|
19
|
+
caselawclient/models/identifiers/press_summary_ncn.py,sha256=r55-qgi9LDnGxY8vTKijzotGknA6mNLpu55QQTV8Lxo,652
|
|
19
20
|
caselawclient/models/identifiers/unpacker.py,sha256=xvp480QESbN36NEc6qeo-orqOBq6WchnLI7thY7A1qs,2156
|
|
20
21
|
caselawclient/models/judgments.py,sha256=xFjfOspa9ZL29gvvGVNq11JC7h-LKebFMrQYvVIIoEI,1868
|
|
21
22
|
caselawclient/models/neutral_citation_mixin.py,sha256=LDaxNndLcTKsjJCyEKO1kGTJ6YD6h-6SzQVE0-gwPSI,2208
|
|
22
23
|
caselawclient/models/press_summaries.py,sha256=bEqJxu-7eBLhwulOsDXYDl2ptIp3RkkMpOcdVvWB5ds,1836
|
|
23
24
|
caselawclient/models/utilities/__init__.py,sha256=u3yIhbTjFQ1JJyAm5wsMEBswWl4t6Z7UMORF5FqC2xQ,1257
|
|
24
|
-
caselawclient/models/utilities/aws.py,sha256=
|
|
25
|
+
caselawclient/models/utilities/aws.py,sha256=d-7puHSW8lFLLhaXhAStzNai4_NEMAiPGCNEFUt0Elg,8191
|
|
25
26
|
caselawclient/models/utilities/dates.py,sha256=WwORxVjUHM1ZFcBF6Qtwo3Cj0sATsnSECkUZ6ls1N1Q,492
|
|
26
27
|
caselawclient/models/utilities/move.py,sha256=Rsx1eGHVjbGz0WMVDjy8b_5t4Ig8aP55sLudL07MVUs,3621
|
|
27
28
|
caselawclient/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -42,7 +43,7 @@ caselawclient/xquery/get_combined_stats_table.xqy,sha256=cclNqSzIB6sX6A_hgVOFZon
|
|
|
42
43
|
caselawclient/xquery/get_components_for_document.xqy,sha256=qBOn5OI7ThK0OHizSm68oySfAdp2dsHFJaIMTI4iIC0,769
|
|
43
44
|
caselawclient/xquery/get_highest_enrichment_version.xqy,sha256=a0dwVmEZuIMyRjIlvenSmbOaaN0WvgaCZvMtVWoLulQ,247
|
|
44
45
|
caselawclient/xquery/get_highest_parser_version.xqy,sha256=LW3iSg4eWArbfBaCVWWOpr4MoUcDBz514nV48ElOsAM,247
|
|
45
|
-
caselawclient/xquery/get_judgment.xqy,sha256=
|
|
46
|
+
caselawclient/xquery/get_judgment.xqy,sha256=34fMHSBNPcXY3u3QIX3Bul8DMuWyGGHrhuYTzxGt3wk,2420
|
|
46
47
|
caselawclient/xquery/get_judgment_checkout_status.xqy,sha256=mdY9UXLyzQdB7byEERPqentlr0YDLbXRVqH0h4UuZTQ,193
|
|
47
48
|
caselawclient/xquery/get_judgment_version.xqy,sha256=wF9k9-CBrqo8VbxxyTrD-AGzR3-3jMm25tRVCjxPLrU,292
|
|
48
49
|
caselawclient/xquery/get_last_modified.xqy,sha256=8fCm_7o_kkytCEmEeSTLWzLP7iOjuPV01IfHDgf6HaQ,172
|
|
@@ -77,7 +78,7 @@ caselawclient/xquery/validate_document.xqy,sha256=PgaDcnqCRJPIVqfmWsNlXmCLNKd21q
|
|
|
77
78
|
caselawclient/xquery/xslt.xqy,sha256=w57wNijH3dkwHkpKeAxqjlghVflQwo8cq6jS_sm-erM,199
|
|
78
79
|
caselawclient/xquery/xslt_transform.xqy,sha256=smyFFxqmtkuOzBd2l7uw6K2oAsYctudrP8omdv_XNAM,2463
|
|
79
80
|
caselawclient/xquery_type_dicts.py,sha256=kybL-YzwK34Fr6MeWfqVOJHYrs0ZNeDWXDsp8o2Yb1U,6114
|
|
80
|
-
ds_caselaw_marklogic_api_client-29.
|
|
81
|
-
ds_caselaw_marklogic_api_client-29.
|
|
82
|
-
ds_caselaw_marklogic_api_client-29.
|
|
83
|
-
ds_caselaw_marklogic_api_client-29.
|
|
81
|
+
ds_caselaw_marklogic_api_client-29.1.1.dist-info/LICENSE.md,sha256=fGMzyyLuQW-IAXUeDSCrRdsYW536aEWThdbpCjo6ZKg,1108
|
|
82
|
+
ds_caselaw_marklogic_api_client-29.1.1.dist-info/METADATA,sha256=SaMj0ydb-vZeW6cnwnwr94lGc_XkADBIDeUdWtDlEjM,4264
|
|
83
|
+
ds_caselaw_marklogic_api_client-29.1.1.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
|
|
84
|
+
ds_caselaw_marklogic_api_client-29.1.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|