Skip to main content

Download client for legal opinions

Project description

A Python library for downloading and researching legal opinions using the Caselaw Access Project API.

An Ethical Open Source Project Test Coverage Percentage GitHub Actions Workflow Documentation Status

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)'

Project details


Download files

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

Source Distribution

justopinion-0.2.5.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

justopinion-0.2.5-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file justopinion-0.2.5.tar.gz.

File metadata

  • Download URL: justopinion-0.2.5.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.7

File hashes

Hashes for justopinion-0.2.5.tar.gz
Algorithm Hash digest
SHA256 e93c5516c3d6fe52df6393e84642d3720db15a5f47d66028748dcc253b1483f2
MD5 a54aecd387de0a926af95ba2254e4647
BLAKE2b-256 4ec7ad38cc02b800cf6da72ac2f52c8a8a24b167a0d2c97f7151d8c8f1203980

See more details on using hashes here.

File details

Details for the file justopinion-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: justopinion-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.7

File hashes

Hashes for justopinion-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d258f8b24e3d60de6baa7ca957eee755e56c8d56f9edf20492e77a99cfa7f2d9
MD5 1bbbe30823a40bac0a105e1a0cd71851
BLAKE2b-256 ce99dcfc5587e5ce8192d7d6e83c5574e4d7b8ac8aba1849c4089e99afad5f5c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page