https://github.com/nationalarchives/ds-caselaw-privileged-api
An API to the National Archives Find Case Law service
https://github.com/nationalarchives/ds-caselaw-privileged-api
api caselaw find-caselaw national-archives
Last synced: about 2 months ago
JSON representation
An API to the National Archives Find Case Law service
- Host: GitHub
- URL: https://github.com/nationalarchives/ds-caselaw-privileged-api
- Owner: nationalarchives
- License: mit
- Created: 2022-08-04T13:59:03.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-09T14:02:35.000Z (about 2 months ago)
- Last Synced: 2025-04-09T15:21:52.210Z (about 2 months ago)
- Topics: api, caselaw, find-caselaw, national-archives
- Language: Python
- Homepage: https://api.caselaw.nationalarchives.gov.uk/docs
- Size: 1.13 MB
- Stars: 6
- Watchers: 5
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# The National Archives: Find Case Law
This repository is part of the [Find Case Law](https://caselaw.nationalarchives.gov.uk/) project at [The National Archives](https://www.nationalarchives.gov.uk/). For more information on the project, check [the documentation](https://github.com/nationalarchives/ds-find-caselaw-docs).
# API Server
Exposing an API to archived case law.
## Requirements.
Python >= 3.12
## Installation & Usage
Ensure that the `MARKLOGIC_API_CLIENT_HOST` environment is set to point at the Marklogic server.
This project uses [Poetry](https://python-poetry.org/) to manage dependencies. You can install them with `poetry install`, and access a virtual environment with `poetry shell`.
To run the server, run `script/server`; open `http://localhost:8080/` in a browser
## Documentation
Run the server and check `http://localhost:8080/docs/`
## Running with Docker (untested)
To run the server on a Docker container, please execute the following from the root directory:
```bash
docker-compose up --build
```## Tests
Run `script/test`
## Linting
Run `pre-commit install` to set up linting, and/or copy the `pre-push.sample` file to `.github/hooks/pre-push`
## Deployment
### Staging
The `main` branch is automatically deployed with each commit. The deployed API Swagger docs can be viewed at
[https://api.staging.caselaw.nationalarchives.gov.uk/docs](https://api.staging.caselaw.nationalarchives.gov.uk/docs)### Production
To deploy to production:
1. Create a [new release](https://github.com/nationalarchives/ds-caselaw-privileged-api/releases).
2. Set the tag and release name to `vX.Y.Z`, following semantic versioning.
3. Publish the release.
4. Automated workflow will then force-push that release to the `production` branch, which will then be deployed to the
production environment.The production Swagger API docs are at
[https://api.caselaw.nationalarchives.gov.uk/docs](https://api.caselaw.nationalarchives.gov.uk/docs)