Decisions

Data models for published judicial decisions.

class justopinion.decisions.ReporterVolume(*, id, url, full_name)

A group of decisions corresponding to a bound print volume.

Parameters:
  • id (int) – The unique identifier for this volume.

  • url (HttpUrl) – The URL of this volume in the Case Access Project API.

  • full_name (str) – The name of this volume.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class justopinion.decisions.Court(*, id, name, url, slug, name_abbreviation='')

A court that issues legal decisions.

Parameters:
  • id (int) – The unique identifier for this court.

  • name (str) – The name of this court.

  • url (HttpUrl) – The URL of this court in the Case Access Project API.

  • slug (str) – The URL-safe name of this court.

  • name_abbreviation (str) – The abbreviation of this court’s name.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class justopinion.decisions.Jurisdiction(*, id, name, url, slug, whitelisted, name_abbreviation='')

A government or other entity that is responsible for a legal system.

Parameters:
  • id (int) – The unique identifier for this jurisdiction.

  • name (str) – The name of this jurisdiction.

  • url (HttpUrl) – The URL of this jurisdiction in the Case Access Project API.

  • slug (str) – The URL-safe name of this jurisdiction.

  • whitelisted (bool) – Whether the jurisdiction’s cases are accessible without restriction in the Case Access Project API.

  • name_abbreviation (str) – The abbreviation of this jurisdiction.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class justopinion.decisions.Opinion(*, type='majority', author='', text='')

A document that resolves legal issues in a case and posits legal holdings.

Usually an opinion must have type="majority" to create holdings binding on any courts.

Parameters:
  • type (str) – the opinion’s attitude toward the court’s disposition of the case. e.g. majority, dissenting, concurring, concurring in the result

  • author (str) – name of the judge who authored the opinion, if identified

  • text (str)

classmethod remove_author_name_punctuation(v)

Normalize Opinion author names by removing punctuation.

Return type:

str

locate_text(selection)

Get set of position selectors for text in Opinion.

Return type:

TextPositionSet

select_text(selector)

Get text using a TextQuoteSelector.

Parameters:

selector (bool | str | TextPositionSelector | TextQuoteSelector | Sequence[str | TextQuoteSelector | TextPositionSelector]) – a selector referencing a text passage in the Opinion.

Return type:

TextSequence

Returns:

the text referenced by the selector, or None if the text can’t be found.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class justopinion.decisions.OpinionCL(*, type='majority', author_str='', plain_text='', resource_uri, id, absolute_url, cluster_id, author_id, per_curiam=False, joined_by=[], joined_by_str='', date_created, date_modified, judges='', sha1='', page_count=None, download_url=None, local_path=None, html='', html_lawbox='', html_columbia='', html_anon_2020='', xml_harvard='', html_with_citations='', extracted_by_ocr=False, opinions_cited=[])

A judicial opinion from the CourtListener API.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class justopinion.decisions.PrecedentialStatus(*values)
class justopinion.decisions.OpinionCluster(*, resource_uri, id, absolute_url, docket_id, docket, citations, sub_opinions, date_created, date_modified, judges, date_filed, date_filed_is_approximate, slug, case_name_short='', case_name, case_name_full='', attorneys='', precedential_status=PrecedentialStatus.PUBLISHED, blocked=False, headmatter='')

A group of opinions that are related to each other, from the CourtListener API.

https://www.courtlistener.com/api/rest/v4/clusters/

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class justopinion.decisions.CaseData(*, head_matter=None, corrections=None, parties=[], attorneys=[], opinions=[], judges=[])

The content of a Decision, including Opinions.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class justopinion.decisions.PageRank(*, percentile, raw)

The rank of the Decision in the collection of documents.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class justopinion.decisions.CaseBody(*, data, status='')

Data about an Opinion in the form used by the Caselaw Access Project API.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class justopinion.decisions.DecisionAnalysis(*, word_count, sha256, orc_confidence=None, char_count, pagerank=None, cardinality, simhash)

Data generated by Case Access Project about a Decision.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

exception justopinion.decisions.DecisionError

Error for failed attempts to assign Opinions to Decisions.

class justopinion.decisions.CitationResponse(*, citation, normalized_citations, start_index, end_index, status, error_message, clusters=[])

A response from the CourtListener API for a citation query.

Parameters:
  • results – The list of citations found in the query.

  • next – The URL of the next page of results, if any.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class justopinion.decisions.DecisionCL(*, opinion_clusters=[], resource_uri, id, court, court_id, clusters, absolute_url, date_created, date_modified, source=None, appeal_from_str='', assigned_to_str='', referred_to_str='', panel_str='', case_name='', case_name_full='', slug, docket_number, blocked=False)
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class justopinion.decisions.Decision(*, decision_date, name=None, name_abbreviation=None, docket_num=None, citations=None, parties=[], attorneys=[], first_page=None, last_page=None, court=None, casebody=None, jurisdiction=None, cites_to=None, id=None, last_updated=None, frontend_url=None, analysis=None)

A court decision to resolve a step in litigation.

Uses the model of a judicial decision from the Caselaw Access Project API.

One of these records may contain multiple Opinions. Typically one record will contain all the Opinions from one appeal, but not necessarily from the whole lawsuit. One lawsuit may contain multiple appeals or other petitions, and if more then one of those generates published Opinions, the CAP API will divide those Opinions into a separate record for each appeal. The outcome of a decision may be determined by one majority Opinion or by the combined effect of multiple Opinions. The lead opinion is commonly, but not always, the only Opinion that creates binding legal authority. Usually every rule posited by the lead Opinion is binding, but some may not be, often because parts of the Opinion fail to command a majority of the panel of judges.

Parameters:
  • decision_date (date) – date when the opinion was first published by the court (not the publication date of the reporter volume)

  • name (str | None) – full name of the opinion, e.g. “ORACLE AMERICA, INC., Plaintiff-Appellant, v. GOOGLE INC., Defendant-Cross-Appellant”

  • name_abbreviation (str | None) – shorter name of the opinion, e.g. “Oracle America, Inc. v. Google Inc.”

  • docket_num (str | None)

  • citations (Sequence[CAPCitation] | None) – ways to cite this Decision

  • parties (list[str])

  • attorneys (list[str])

  • first_page (int | None) – the page where the opinion begins in its official reporter

  • last_page (int | None) – the page where the opinion ends in its official reporter

  • court (Court | None) – name of the court that published the opinion

  • casebody (CaseBody | None) – the Decision content including Opinions

  • juridiction – the jurisdiction of the case

  • cites_to (Sequence[CAPCitation] | None) – CAPCitations to other Decisions

  • id (int | None) – unique ID from CAP API

  • last_updated (datetime | None) – date when the record was last updated in CAP API

  • frontend_url (HttpUrl | None) – URL to the decision in CAP’s frontend

  • analysis (DecisionAnalysis | None) – data generated by Case Access Project about this Decision

classmethod decision_date_must_include_day(v)

Add a day of “01” if a string format is missing it.

Return type:

date | str

property opinions: list[Opinion]

Get all Opinions published with this Decision.

property majority: Opinion | None

Get a majority opinion, if any.

find_matching_opinion(opinion_type='', opinion_author='')

Get Opinion matching the given attributes.

Return type:

Opinion | None

add_opinion(opinion)

Add an Opinion to self’s CaseBody if the Opinion doesn’t already exist.

Return type:

None

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].