Skip to main content

OpenCaseLaw research CLI

Dependency-free Python 3.10+ client for the public, read-only research API. Install from the repository with pipx install ./clients/python (or uv tool install ./clients/python); both create the isolated environment that current Python installations require. Without them, use a virtual environment: python3 -m venv .venv && .venv/bin/pip install ./clients/python. 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.0.tar.gz (48.3 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.0-py3-none-any.whl (37.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: opencaselaw_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 48.3 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.0.tar.gz
Algorithm Hash digest
SHA256 6faf56e7224227e62015f5dfd0dd076cf88699c2b33f39d40438ac639f0957a7
MD5 c5d667b8a8aa35fb42be07379b217207
BLAKE2b-256 e8afa7cdda5bccb029416be27bb29b5cba2de0d000bf0ae41145ed9eafe5ab2b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for opencaselaw_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 46943907f43208fecb4bfa885dba69ff3b6d712655ff1ba32691981a467cc530
MD5 3c852187a86d9970cbde730fa76db68e
BLAKE2b-256 91c1e6086a6ba786f82b7dc23b2193a082e2be868c9205e763f03474290dc11c

See more details on using hashes here.

Provenance

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

0.3.0

2 files

0.2.1

2 files

This release

0.2.0 This release

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