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.2.1.tar.gz (50.6 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.2.1-py3-none-any.whl (38.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: opencaselaw_cli-0.2.1.tar.gz
  • Upload date:
  • Size: 50.6 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.2.1.tar.gz
Algorithm Hash digest
SHA256 db463dfabc5d2fa23a988b9935c4a05d4a9730a11eba0e9428393daf4df027b7
MD5 71937878b8f314d3ed65474fbed58c5a
BLAKE2b-256 0cfc4bd4dcf3428494a2cb15b9ecf312273d9c211cec4432ad7cf531aeccfced

See more details on using hashes here.

Provenance

The following attestation bundles were made for opencaselaw_cli-0.2.1.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.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for opencaselaw_cli-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ea0e3a2a5c2c35d5a74c369de07b1c4ee4939ca405a7fb07f6145bcfee16e234
MD5 8b78dbe83e918251c3c42fc5ce3d47c6
BLAKE2b-256 033d0c6245ec47f63d4bee549b42a4ba17211937990bdadc7bb4d63645347b41

See more details on using hashes here.

Provenance

The following attestation bundles were made for opencaselaw_cli-0.2.1-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

0.3.0

2 files

This release

0.2.1 This release

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