Skip to main content

OpenCaseLaw research CLI

Dependency-free Python 3.10+ client for the public, read-only research API. Install with pipx install opencaselaw-cli (or uv tool install opencaselaw-cli); both create the isolated environment that current Python installations require. Without them, use a virtual environment: python3 -m venv .venv && .venv/bin/pip install opencaselaw-cli. This package does not install scraper/server dependencies or a local corpus.

ocl --help
ocl citations resolve 'BGE 136 III 513' '4A_747/2012'          # do these exist, and which decisions are they?
ocl bundle create 'Rachekündigung Art. 336 OR' --max-results 10 --passage 2 --law OR:336 --out evidence
ocl decisions search 'Rachekündigung' --max-results 5 --format jsonl | ocl decisions get --stdin --format jsonl > decisions.jsonl
ocl decisions passage bge_BGE_136_III_513 2.3

A bundle folder holds the selected decisions (JSON and plain text), the named Erwägungen and statute articles, a plain-language INDEX.md, and a manifest.json with every request, timestamp, source link and file hash.

See the repository's research CLI guide for provenance, batch inputs, pagination, partial failures and repeatable workflows. Commands contact https://mcp.opencaselaw.ch by default; --base-url accepts an alternative HTTP(S) origin. Results come from a changing hosted corpus, not an offline snapshot. Preserve returned source evidence and pagination metadata.

Exit codes: 0 success (including a bounded selection); 2 invalid input; 3 API or transport failure; 4 partial or unresolved result; 130 interruption. At a terminal the output is readable text (--color never or NO_COLOR for plain text); piped, or with --format json|jsonl, it is JSON on stdout; table, csv and md are for documents. Defaults can live in ~/.config/ocl/config or OCL_* variables; ocl completion zsh|bash|fish prints a completion script. Diagnostics go to stderr. The client retries at most twice by default, spaces requests by at least 200 ms, and respects Retry-After up to 30 seconds; longer server delays fail without an early retry.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opencaselaw_cli-0.3.0.tar.gz (69.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opencaselaw_cli-0.3.0-py3-none-any.whl (51.1 kB view details)

Uploaded Python 3

File details

Details for the file opencaselaw_cli-0.3.0.tar.gz.

File metadata

  • Download URL: opencaselaw_cli-0.3.0.tar.gz
  • Upload date:
  • Size: 69.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for opencaselaw_cli-0.3.0.tar.gz
Algorithm Hash digest
SHA256 eb73b61d1a2d53b0717e3ccad8ad28c8c0e1476557b7ba9fce629292061496d3
MD5 bb1976712f8e34a73620ff1e747b4703
BLAKE2b-256 2b535d8d77625823702807a79f481bae8537f820c45e30b9d209e8d867e298ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for opencaselaw_cli-0.3.0.tar.gz:

Publisher: release-cli.yml on jonashertner/opencaselaw

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file opencaselaw_cli-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for opencaselaw_cli-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 68b6b489bb4425ff314955dea1b97c09af7a9c4613021911d773563536cb13d6
MD5 97b1df8cb324ac6dbe04b17f19067681
BLAKE2b-256 03e53d3b3e584b07da8f163892059c446f43f44d79fc42a3daafddb761175a23

See more details on using hashes here.

Provenance

The following attestation bundles were made for opencaselaw_cli-0.3.0-py3-none-any.whl:

Publisher: release-cli.yml on jonashertner/opencaselaw

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.9.1

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

0.3.1

2 files

This release

0.3.0 This release

2 files

0.2.1

2 files

0.2.0

2 files

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