Skip to main content

The National Archives: Find Case Law

This repository is part of the Find Case Law project at The National Archives. For more information on the project, check the documentation.

MarkLogic API Client

PyPI Libraries.io dependency status for latest release Code Coverage

This is an API Client for connecting to Marklogic for The National Archive's Caselaw site.

This package is published on PyPI: https://pypi.org/project/ds-caselaw-marklogic-api-client/

Usage

You can find documentation of the client class and available methods here.

Testing

To run the test suite:

poetry install
poetry run pytest

MarkLogic integration tests live under tests/marklogic/ and are opt-in: the default poetry run pytest excludes them (-m 'not marklogic'). They replace the old standalone smoketest/ module and load a fixed corpus from marklogic_harness/fixtures/documents/ (URIs under test/… as well as smoketest/…) so CI does not depend on staging.

CI runs them in a dedicated job: it starts MarkLogic from nationalarchives/ds-caselaw-marklogic, runs gradle mlWaitTillReady mlDeploy mlReloadSchemas, then runs the harness (see .github/workflows/test.yml). The merge fixture tests require the compiled_url_slugs TDE view from the caselaw templates.

Tests must run as a user with the same roles as production, not admin (for example, TDE views such as documents.compiled_url_slugs are only visible to roles with read permission on the templates, and admin has none). script/create_marklogic_test_user creates one with the roles of caselaw-editor-ui from ds-caselaw-marklogic.

Local setup: you must create the test user before running the integration harness against Docker or another MarkLogic instance. This is required on every fresh instance (for example a new container or wiped data); the harness rejects admin. Set MARKLOGIC_HOST, MARKLOGIC_USER, and MARKLOGIC_PASSWORD in a .env file, then:

MARKLOGIC_USER=caselaw-api-client-test MARKLOGIC_PASSWORD=... script/create_marklogic_test_user ../ds-caselaw-marklogic
poetry run pytest -o addopts= -p marklogic_harness.pytest_plugin -m marklogic tests/marklogic

Making changes

When making a change, update the changelog using the Keep a Changelog 1.0.0 format. Pull requests should not be merged before any relevant updates are made.

Deployment

This repository will auto-deploy documentation to GitHub Pages when changes are made to main.

Release process

When making a new release, update the changelog in the release pull request.

The package will only be released to PyPI if the branch is tagged. A merge to main alone will not trigger a release to PyPI.

To create a release:

  1. Update the version number in pyproject.toml
  2. Create a branch release/v{major}.{minor}.{patch}
  3. Update CHANGELOG.md for the release
  4. Commit and push
  5. Open a PR from that branch to main
  6. Get approval on the PR
  7. Merge the PR to main and push
  8. Tag the merge commit on main with v{major}.{minor}.{patch} and push the tag
  9. Create a release in Github releases using the created tag

If the release fails to push to PyPI, you can delete the tag with git pull, git push --delete origin v1.2.3 and try again.

Metadata

Release files for ds-caselaw-marklogic-api-client 51.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ds-caselaw-marklogic-api-client 51.0.1
File Size Uploaded Provenance Actions
ds_caselaw_marklogic_api_client-51.0.1.tar.gz 102.4 kB With provenance Details for ds_caselaw_marklogic_api_client-51.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ds-caselaw-marklogic-api-client 51.0.1
File Interpreter ABI Platform Actions
ds_caselaw_marklogic_api_client-51.0.1-py3-none-any.whl Python 3 none any Details for ds_caselaw_marklogic_api_client-51.0.1-py3-none-any.whl

Total release size: 258.2 kB

Release files / ds_caselaw_marklogic_api_client-51.0.1.tar.gz

Download URL ds_caselaw_marklogic_api_client-51.0.1.tar.gz
Size 102.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a3873e5c1afe48aa014ab39205f3740a206c4b8d8e67ffed0bd5e89a51dcaca2
BLAKE2b-256 checksum
How to use checksums
a8c61dbd699d42664df9860c6471d53c63fbbbdac8a19bce09df20beb8bb7476
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / ds_caselaw_marklogic_api_client-51.0.1-py3-none-any.whl

Download URL ds_caselaw_marklogic_api_client-51.0.1-py3-none-any.whl
Size 155.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5230894bfff034effc2093926c7ba5a96a01d12de6e7aebb4f3a9e40ceea795e
BLAKE2b-256 checksum
How to use checksums
5d1ec4302f43b8c56d6a69bd4bc5d37046d14a8c89b09fa9f8fd83a1bcc5c4b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for ds-caselaw-marklogic-api-client 51.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ds_caselaw_marklogic_api_client-51.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

51.0.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page