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
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:
- Update the version number in
pyproject.toml - Create a branch
release/v{major}.{minor}.{patch} - Update
CHANGELOG.mdfor the release - Commit and push
- Open a PR from that branch to main
- Get approval on the PR
- Merge the PR to main and push
- Tag the merge commit on
mainwithv{major}.{minor}.{patch}and push the tag - 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.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ds_caselaw_marklogic_api_client-51.0.2.tar.gz | 103.0 kB | With provenance | Details for ds_caselaw_marklogic_api_client-51.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ds_caselaw_marklogic_api_client-51.0.2-py3-none-any.whl | Python 3 | none | any | Details for ds_caselaw_marklogic_api_client-51.0.2-py3-none-any.whl |
Total release size: 259.4 kB
Release files / ds_caselaw_marklogic_api_client-51.0.2.tar.gz
| Download URL | ds_caselaw_marklogic_api_client-51.0.2.tar.gz |
|---|---|
| Size | 103.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7ec8eedda9b2aa95f0f6ca92449f6deff6055d0e3057ec871828acf8e014d554
|
|
BLAKE2b-256 checksum How to use checksums |
ed55671c68ab0fd3d64c4b799d33e642b9c4563fc8e6fbb9f6a064f4e94fc912
|
| 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 Nov 12, 2026.
Transparency logRelease files / ds_caselaw_marklogic_api_client-51.0.2-py3-none-any.whl
| Download URL | ds_caselaw_marklogic_api_client-51.0.2-py3-none-any.whl |
|---|---|
| Size | 156.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f6b561a56bbbd6dbb1d7c9b381e470699a00a5445903d8ba5f97565bf563552b
|
|
BLAKE2b-256 checksum How to use checksums |
06b71fb20d971dc590588c5035878d0ecfd1eea66d6eb7c178ee89b80aab8ad9
|
| 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 Nov 12, 2026.
Transparency logSecurity for ds-caselaw-marklogic-api-client 51.0.2
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.
Attestation for ds_caselaw_marklogic_api_client-51.0.2.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 Nov 12, 2026.
Transparency logA 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.