Skip to main content

A Python library for downloading and researching legal opinions using the Caselaw Access Project API. Note that new CAP accounts are no longer available and the CAP API was sunset on September 1, 2024.

An Ethical Open Source Project Test Coverage Percentage GitHub Actions Workflow Documentation Status PyPI - Python Version

Examples

In this example, Justopinion is used to download the decision with the citation 1 Breese 34.

>>> import os
>>> from justopinion import CAPClient
>>> client = CAPClient(api_token=os.getenv("YOUR_SECRET_API_TOKEN"))
>>> thornton = client.read_cite("1 Breese 34", full_case=True)
>>> thornton.casebody.data.parties[0]
'John Thornton and others, Appellants, v. George Smiley and John Bradshaw, Appellees.'

You can also use Justopinion to locate text in an opinion:

>>> thornton.opinions[0].locate_text("The court knows of no power in the administrator")
TextPositionSet{TextPositionSelector[22, 70)}

Or to get the text from a specified location in the opinion:

>>> selection = thornton.opinions[0].select_text([(258, 294), (312, 359)])
>>> str(selection)
'…The note was made to West alone, and…the suit should have been commenced in his name…'

And you can use Justopinion to follow citations in an opinion and download the cited cases:

>>> str(thornton.cites_to[0])
'Citation to 15 Ill., 284'
>>> cited = client.read_cite(thornton.cites_to[0], full_case=True)
>>> str(cited)
'Marsh v. People, 15 Ill. 284 (1853-12-01)'

Metadata

Release files for justopinion 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for justopinion 0.4.0
File Size Uploaded Provenance
justopinion-0.4.0.tar.gz 21.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for justopinion 0.4.0
File Interpreter ABI Platform
justopinion-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 31.9 kB

Release files / justopinion-0.4.0.tar.gz

Download URL justopinion-0.4.0.tar.gz
Size 21.3 kB
Tags Source
SHA-256 checksum
How to use checksums
12441dfd110a278f031db65ddc3116d3116f58cf55903cced0d5134c307e8ee3
BLAKE2b-256 checksum
How to use checksums
78703901baa161c1bd0a6e30bed25bdfbab7bd2103c7d2bccb521e96167aa239
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.1

Release files / justopinion-0.4.0-py3-none-any.whl

Download URL justopinion-0.4.0-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1da0d2e65fc7273ee68c19e4d5d52229724bf8438169a28b419947f5ea1e8c9f
BLAKE2b-256 checksum
How to use checksums
8e09baa6320d52b019e0b36528f11a316d327b737999d12f34a2b91a952acae9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.1

Security for justopinion 0.4.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

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