Repository navigation
Release: 0.2.2
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, andcaption2) when the header's caption names no appellant
or appellee, and codeparty1_appellant,party1_appellee,
party2_appellant, andparty2_appelleefrom 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
codedecision_affirm,decision_reverse,decision_vacate,
decision_remand, anddecision_dismissfrom it. courtpy.judgesidentifies the judges on each case, which the earlier,
unreleased CourtPy did and this version had not rebuilt. ARoster
(Roster.from_fjc()) is made from the Federal Judicial Center's files of
judges' service, demographics, and careers, whichdownloadgets, 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(anamos.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_namesandpanel_found) and the panel's composition: the mean of
each attribute of its judges, such aspanel_party,panel_woman,
panel_age, andpanel_designated. It is built from thelists_to_rows
shaper of amos,merge_judges, and themerge_summarymerger.judge_votes(anamos.Shaper) andcourtpy.judges.vote_tablemake 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_reversaland 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_casesreads thecase_idcolumn of a saved table of votes as text,
so a study splits its cases the same way when the table is reused.courtpy.politicsandcode_politicsadd the political context of each
case's year: the party of the president and, from a table that
build_tablemakes, the Supreme Court's Martin-Quinn scores and the
median NOMINATE scores of each chamber of Congress.code_politicsis the
merge_keysmerger 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.downloadgets 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), andbuild_table,martin_quinn, and
nominateuse them when they are given no files.
courtpy.politics.justicesreturns the Martin-Quinn score of each justice
in each term.courtpy.scdbadds the Supreme Court Database.downloadgets the latest
release from https://scdb.la.psu.edu/data/,casesandvotesreturn its
case centered and justice centered tables, andcode_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 asscdb_id.examples/judge_votes.iniis 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_judgescomes 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 ispanel_text.code_outcomeuses the decision that the opinion states when the header
has no disposition, and the opinion's words anywhere (opinion_reverse,
opinion_vacate, andopinion_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.