Skip to content

Release: 0.2.2

Choose a tag to compare

@github-actions github-actions released this 10 Oct 19:29

Updated to amos 0.2.6, whose mergers
and shapers join tables whose rows are different things. CourtPy uses them to
add judges, the politics of each year, and the Supreme Court Database to
cases, and downloads other researchers' data from its sources.

The federal rules now read what recent CourtListener cases have only in the
text of their opinions. CourtListener's full case name, judges, and
disposition are blank for about nine in ten of the federal appellate cases
filed since 2025, so the parties' roles and the panel were unknown, and
reversals were coded from the opinion's words anywhere. In a sample of 1,500
such criminal appeals, the roles are now found in 97%, and a panel of three
judges in 99%.

Added

  • The federal rules find the caption in the opinion's opening (caption,
    caption1, and caption2) when the header's caption names no appellant
    or appellee, and code party1_appellant, party1_appellee,
    party2_appellant, and party2_appellee from it. A caption is a role
    before "v." ("Plaintiff-Appellee, v."), or parties in capital letters
    with one role, so a citation in the opinion's words is not mistaken for
    one.
  • The federal rules find the decision that an opinion states (decision:
    "AFFIRMED.", "VACATED AND REMANDED.", "Affirmed by unpublished per
    curiam opinion", or "we reverse", but not "we will reverse only if") and
    code decision_affirm, decision_reverse, decision_vacate,
    decision_remand, and decision_dismiss from it.
  • courtpy.judges identifies the judges on each case, which the earlier,
    unreleased CourtPy did and this version had not rebuilt. A Roster
    (Roster.from_fjc()) is made from the Federal Judicial Center's files of
    judges' service, demographics, and careers, which download gets, and
    matches a name in an opinion to a judge of the case's court, or else of a
    district court in its circuit, or else of another court, among the judges
    serving in the case's year. The careers are coded by the rules in
    instructions/judges.csv. Unlike the earlier version, a name that fits
    more than one judge is left unmatched instead of being given to one of
    them, no judge is matched outside the judge's years of service, a judge
    who was reassigned to another court keeps the appointment of the judge's
    own earlier service, a rating or vote that is not recorded is missing
    instead of zero, the district courts of Vermont are in the Second Circuit,
    and a clerkship at a district court does not make a judge a prosecutor.
  • merge_judges (an amos.Merger) adds what the roster says about the
    judge that each row names, such as the author of each opinion, with a
    prefix: the judge's attributes, and the judge's age, senior status, and
    whether the judge sat by designation in the case's year and court. Like
    every merger, it takes "source", "columns", "prefix", and "indicator",
    never adds or removes a row, and records how many rows it matched.
  • code_judges (a munger) adds the judges of each panel who were found
    (panel_names and panel_found) and the panel's composition: the mean of
    each attribute of its judges, such as panel_party, panel_woman,
    panel_age, and panel_designated. It is built from the lists_to_rows
    shaper of amos, merge_judges, and the merge_summary merger.
  • judge_votes (an amos.Shaper) and courtpy.judges.vote_table make a
    table with one row for each judge on each case, with the judge's
    attributes (judge_{attribute}), those of the other judges of the panel
    (colleagues_{attribute}), and the judge's vote on each outcome
    (vote_reversal and so on: the outcome, or its opposite for a judge who
    dissented). Like every shaper, it takes "label", "task", and "groups" for
    the table that it makes, and must come before the data is split. It can be
    one of a loader's coders, so a vote can be the label of a study, and
    load_cases reads the case_id column of a saved table of votes as text,
    so a study splits its cases the same way when the table is reused.
  • courtpy.politics and code_politics add the political context of each
    case's year: the party of the president and, from a table that
    build_table makes, the Supreme Court's Martin-Quinn scores and the
    median NOMINATE scores of each chamber of Congress. code_politics is the
    merge_keys merger of amos with the year as its key, so it takes that
    merger's parameters ("source", "on", "other_on", "columns", "prefix",
    "indicator", and "duplicates"), and a table with a year twice stops a
    study instead of quietly using one of its rows. A term of the court that
    the scores divide in two (as 2005 is) is one year, which the earlier
    version's table had twice.
  • courtpy.politics.download gets the current files of Martin-Quinn scores
    (from the links of https://mqscores.wustl.edu/measures.php) and of the
    ideology of members of Congress (the "Member Ideology" data of
    https://voteview.com/data), and build_table, martin_quinn, and
    nominate use them when they are given no files.
    courtpy.politics.justices returns the Martin-Quinn score of each justice
    in each term.
  • courtpy.scdb adds the Supreme Court Database. download gets the latest
    release from https://scdb.la.psu.edu/data/, cases and votes return its
    case centered and justice centered tables, and code_scdb (an
    amos.Merger) adds its coding to parsed cases of the Supreme Court
    (scdb_issueArea, scdb_decisionDirection, and so on), matched by the
    database's id of each case or else by a citation. CourtListener cases of
    the Supreme Court have that id as scdb_id.
  • examples/judge_votes.ini is a study of how judges vote in criminal
    appeals.

Changed

  • Requires amos 0.2.6.
  • The repository is "courtpy" (in lower case, like the package), so the
    links to it and to the documentation, which had stopped working, are
    https://github.com/WithPrecedent/courtpy and
    https://WithPrecedent.github.io/courtpy.
  • panel_judges comes from the panel that the opinion's opening names
    ("Before SMITH, Chief Judge, and JONES and BROWN, Circuit Judges", or
    "Present:"), including a judge sitting by designation, and only
    otherwise from the source's list of judges, which in CourtListener may
    name only the author or be blank. The text that was used is panel_text.
  • code_outcome uses the decision that the opinion states when the header
    has no disposition, and the opinion's words anywhere (opinion_reverse,
    opinion_vacate, and opinion_remand) only when there is neither. Those
    words are often about an earlier decision or a standard of review ("we
    will reverse only if"): in the sample, they coded 17% of defendants'
    appeals as reversals, and the stated decisions 9%.

Fixed

  • A judge's middle initial "J." is no longer read as "Justice", which
    divided "LAWRENCE J. VILARDO" into two judges, and initials such as
    "S.R." before a name are no longer read as "Sr.", which left "S.R.
    THOMAS" as "THOMAS". "J.", "JR.", and "SR." are still removed when no
    name follows them.