Skip to content

Catalog

This page lists courtpy's techniques and the columns that its rulebooks make. It is built from courtpy itself each time the documentation is built, so it is always current. A study's settings can name any of these techniques (see Building a Study).

Techniques

Genre Technique Module Does
case_loader load_cases courtpy.wrangler.loaders Loads a dataset of cases saved by Cases.save, or a table of one.
cleaner drop_text_columns courtpy.wrangler.coders Removes columns that models cannot use, such as text and lists.
describer compare_with_idb courtpy.references.fjc_idb Compares a dataset with the Integrated Database's records of appeals.
evaluator audit_coverage courtpy.critic.audits Compares the cases of each court in each year with the database's.
evaluator audit_parsing courtpy.critic.audits Counts the cases that lack what the rules should find.
evaluator audit_random_assignment courtpy.critic.audits Checks that the traits of cases are balanced across their panels.
evaluator validate_coding courtpy.critic.audits Measures how often courtpy's coding agrees with another source's.
inferer panel_effects courtpy.critic.inferers Estimates the effect of a judge's colleagues on the judge's vote.
merger add_biography courtpy.references.judges Adds what a roster says about each judge that each row names.
merger add_circuit courtpy.references.judges Adds the ideology of the active judges of each case's circuit.
merger add_court_scores courtpy.references.scores Adds scores of each case's court from a table of them.
merger add_executive courtpy.references.politics Adds the executive in power when each case was decided.
merger add_high_court courtpy.references.politics Adds the ideology of the Supreme Court when each case was decided.
merger add_idb courtpy.references.fjc_idb Adds the Integrated Database's record of each appeal by its docket.
merger add_jcs courtpy.references.judges Adds the Judicial Common Space score of each judge that each row names.
merger add_judge_scores courtpy.references.scores Adds scores of each judge of each row from a table of them.
merger add_legislature courtpy.references.politics Adds the ideology of Congress when each case was decided.
merger add_scdb courtpy.references.scdb Adds the Supreme Court Database's columns to each case.
munger code_case_type courtpy.wrangler.coders Decides whether each case is criminal or civil, and its other types.
munger code_outcome courtpy.wrangler.coders Decides whether each decision reversed the court below, and who won.
munger code_panels courtpy.references.judges Adds the judges and the composition of each case's panel.
munger code_parties courtpy.wrangler.coders Completes the roles of the parties and finds who brought the appeal.
munger split_values courtpy.wrangler.coders Turns text with several values in each cell into lists or columns.
munger tidy_cases courtpy.wrangler.coders Gives columns of booleans or whole numbers with missing values a type.
parser parse_agencies courtpy.wrangler.rules Applies the rules of "federal/agencies.csv".
parser parse_all courtpy.wrangler.parsers Finds information in text with rules, or parses cases again.
parser parse_citations courtpy.wrangler.rules Applies the rules of "general/citations.csv".
parser parse_civil courtpy.wrangler.rules Applies the rules of "general/civil.csv", "federal/civil.csv".
parser parse_constitutional courtpy.wrangler.rules Applies the rules of "general/constitutional.csv".
parser parse_courtlistener_header courtpy.wrangler.rules Finds the parties, their roles, and the judges in a CourtListener case.
parser parse_criminal courtpy.wrangler.rules Applies the rules of "general/criminal.csv", "federal/criminal.csv".
parser parse_federal courtpy.wrangler.rules Applies the rulebooks of every topic, in order: general, citations, civil, constitutional, criminal, review, agencies.
parser parse_general courtpy.wrangler.rules Applies the rules of "general/general.csv".
parser parse_header courtpy.wrangler.rules Finds the parties, their roles, and the judges in the header of a case from a source with no header rules of its own.
parser parse_lexis_nexis courtpy.wrangler.rules Finds the sections of a Lexis-Nexis case of a federal court of appeals.
parser parse_lexis_nexis_header courtpy.wrangler.rules Finds the court, the parties, their roles, and the judges in the header of a Lexis-Nexis case.
parser parse_review courtpy.wrangler.rules Applies the rules of "federal/review.csv".
plot cases_over_time courtpy.artist.plots Plots the number of cases of each court in each year.
plot court_rates courtpy.artist.plots Plots the rate of a column in each court, as bars.
plot idb_confusion_matrices courtpy.artist.plots Plots how the data agrees with the Integrated Database, by variable.
plot idb_missing_differences courtpy.artist.plots Plots how the appeals that the data lacks differ, by group.
plot issues_over_time courtpy.artist.plots Plots the number of cases with each issue in each court in each year.
plot judge_network courtpy.artist.plots Plots the judges as a network of who sat with, or dissented from, whom.
plot lower_court_rates courtpy.artist.plots Plots the rate of a column for each court below, by reviewing court.
plot panel_composition courtpy.artist.plots Plots the rate of a column for each composition of the panel.
plot trends_by_administration courtpy.artist.plots Plots the yearly rate of a column in each court, with presidents.
reference_loader download_biographies courtpy.references.judges Downloads the Federal Judicial Center's files and loads their roster.
reference_loader download_idb courtpy.references.fjc_idb Downloads the Integrated Database's files and loads its appeals.
reference_loader download_jcs courtpy.references.jcs Downloads the published files of Judicial Common Space scores.
reference_loader download_politics courtpy.references.politics Downloads the sources of the political context and loads its table.
reference_loader download_scdb courtpy.references.scdb Downloads the Supreme Court Database and loads its cases or votes.
reference_loader load_idb courtpy.references.fjc_idb Loads the Integrated Database's table of appeals for a range of years.
reference_loader load_politics courtpy.references.politics Loads a table of the political context of each year.
reference_loader load_roster courtpy.references.judges Loads the table of a roster of judges.
reference_loader load_scdb courtpy.references.scdb Loads the Supreme Court Database's table of cases or of votes.
shaper cases_to_case_types courtpy.wrangler.shapers Makes a table with one row for each case type.
shaper cases_to_courts courtpy.wrangler.shapers Makes a table with one row for each court.
shaper cases_to_dockets courtpy.wrangler.shapers Makes a table with one row for each docket number of each case.
shaper cases_to_judges courtpy.references.judges Makes a table with one row for each judge (Judges).
shaper cases_to_party_types courtpy.wrangler.shapers Makes a table with one row for each party type.
shaper cases_to_votes courtpy.references.judges Makes a table with one row for each judge on each case (Votes).
shaper dockets_to_cases courtpy.wrangler.shapers Makes a table of dockets a table of cases again.
shaper dockets_to_votes courtpy.references.judges Makes a table with one row for each judge on each docket (Votes).
shaper votes_to_cases courtpy.references.judges Makes a table of votes a table of cases again (Cases).
source_loader download_courtlistener courtpy.wrangler.loaders Downloads cases from CourtListener, and parses and codes them.
source_loader load_courtlistener courtpy.wrangler.loaders Parses and codes cases saved from CourtListener.
source_loader load_lexis_nexis courtpy.wrangler.loaders Divides, parses, and codes cases downloaded from Lexis-Nexis.

Sources

courtpy parse --source (and a loader that subclasses SourceLoader) can name any source. A study can add its own (see Building a Study). download_courtlistener and courtpy download save cases of the courtlistener source, from the bulk data (method = bulk, the default) or the API (method = api).

Source Files Does
courtlistener *.json Reads cases saved by CourtListener, from the bulk data or the API.
lexis_nexis *.txt Reads Lexis-Nexis cases saved one to a text file (see split).

Rulebooks and their columns

Each rulebook below can be named in the "rulebooks" of a loader or of courtpy.parse. "header" and "general" are applied to every case. The columns of a rulebook are those that its rules make, in the order of the rules; see the rules guide for what each kind of rule makes.

general

Applies the rules of "general/general.csv".

27 columns: opinion_affirm, opinion_deny, opinion_reverse, opinion_vacate, opinion_remand, opinion_dismiss, opinion_enforce, decision, decision_affirm, decision_reverse, decision_vacate, decision_remand, decision_dismiss, procedure_pro_se, procedure_indigent, procedure_mandamus, procedure_mootness, procedure_interloc, procedure_jury_trial, standard_de_novo, standard_clear_error, standard_abuse_disc, standard_arb_cap, standard_mixed_question, standard_substantial_evidence, standard_plain_error, standard_named

citations

Applies the rules of "general/citations.csv".

6 columns: citations_admin, citations_case, citations_statute, citations_legislature, citations_constitution, citations_other

civil

Applies the rules of "general/civil.csv", "federal/civil.csv".

143 columns: civil_bad_faith, civil_good_faith, civil_fiduciary, civil_bankruptcy, civil_forfeiture, civil_foreclosure, civil_veil_piercing, civil_antitrust, civil_qual_imm, civil_abs_imm, civil_workers_compensation, civil_declaratory_judgment, civil_admin_subp, civil_min_wage, civil_bjr, tort_iied, tort_negligence, tort_assault, tort_strict_liability, tort_interference, tort_false_imprisonment, tort_convesion, tort_express_warranty, tort_implied_warranty, tort_anticipatory_repudiation, tort_unjust_enrichment, tort_quantum_meruit, tort_hazardous_substance, tort_asbestos, tort_med_mal, tort_defamation, tort_product_liability, tort_class_action, tort_wrongful_discharge, tort_excessive_force, tort_deceptive_marketing, tort_fraud, ip_patent, ip_copyright, ip_trademark, ip_trade_secret, contract_promissory_estoppel, tort_invasion_privacy, tort_public_disclosure, tort_flase_light, tort_unpaid_wages, tort_civil_rights, writ_habeas, contract_breach, civil_lanham_act, civil_medicaid, civil_medicare, civil_hous_discrim, civil_plra, civil_vra, civil_twombly, civil_iqbal, civil_habeas, civil_asylum, civil_titlevii, civil_titleix, civil_ada, civil_adea, civil_patent, civil_copyright, civil_trademark, civil_cercla, civil_caa, civil_cwa, civil_tax, civil_labor, civil_social_security, civil_sec1983, civil_div_juris, civil_fed_quest, civil_foia, civil_civ_serv_act, civil_fed_employ_pay, civil_fed_labor_rel, civil_commodity_acts, civil_food_sec, civil_false_claims, civil_animal_welf, civil_agric_fair, civil_ina, civil_arb_act, civil_mortgage_act, civil_fdic, civil_bank_holding, civil_respra, civil_clayton_act, civil_trade_comm_act, civil_coppa, civil_sec_act, civil_invest_comp, civil_small_bus_act, civil_haz_subst, civil_truth_lend, civil_fair_credit_bill, civil_fair_credit_report, civil_fair_debt_collect, civil_product_safe, civil_asbestos, civil_national_historic_preservat, civil_migratory_bird, civil_esa, civil_lacey_act, civil_dmca, civil_terrorism_civil, civil_ferpa, civil_idea, civil_fda_act, civil_med_mal, civil_icwa, civil_indian_gaming, civil_admiralty, civil_atca, civil_erisa, civil_fmla, civil_foreign_sov_imm, civil_food_stamp, civil_defame, civil_sec_fraud, civil_prod_liab, civil_class_act, civil_aedpa, civil_all_writs, civil_rulemaking, civil_fed_tort_act, civil_osha, civil_mine_safety, civil_sdwa, civil_hhs, civil_voter_regis_act, civil_civ_rt_act, civil_rfra, civil_legal_serv, civil_solid_waste_act, civil_vawa, civil_rail_labor, civil_wrong_discharge, civil_fed_comm_act, civil_phone_consum_act

constitutional

Applies the rules of "general/constitutional.csv".

31 columns: constitutional_amend1_religion, constitutional_amend1_speech, constitutional_amend1_general, constitutional_amend2, constitutional_amend3, constitutional_amend4, constitutional_amend5_miranda, constitutional_amend5_general, constitutional_amend6, constitutional_amend7, constitutional_amend8, constitutional_amend9, constitutional_amend10, constitutional_amend11, constitutional_amend12, constitutional_amend13, constitutional_amend14, constitutional_amend15, constitutional_articlei, constitutional_articleii, constitutional_articleiii, constitutional_articleiv, constitutional_expostfacto, constitutional_rule_law, constitutional_indian_commerce, constitutional_standing, constitutional_ripeness, constitutional_commerce_clause, constitutional_strict_scrutiny, constitutional_intermediate_scrutiny, constitutional_rational_basis

criminal

Applies the rules of "general/criminal.csv", "federal/criminal.csv".

65 columns: criminal_death_penalty, criminal_lenity, criminal_child_porn, criminal_conspiracy, criminal_drugs, criminal_wire_fraud, criminal_kidnapping, criminal_tax_evasion, criminal_bank_robbery, criminal_robbery, criminal_assault, criminal_bank_fraud, criminal_arson, criminal_bribery, criminal_child_support, criminal_color_of_law, criminal_counterfeit, criminal_crim_contempt, criminal_forgery, criminal_voter_intim, criminal_campaign, criminal_gangs, criminal_embezzlement, criminal_money_launder, criminal_escape, criminal_harboring, criminal_chem_bio, criminal_nuclear, criminal_extortion, criminal_kickbacks, criminal_firearm, criminal_false_statements, criminal_perjury, criminal_murder, criminal_manslaughter, criminal_gambling, criminal_obscenity, criminal_obstruction, criminal_slavery, criminal_rico, criminal_riots, criminal_sabotage, criminal_child_sexual, criminal_destruct_ev, criminal_stalking, criminal_rape, criminal_terrorism, criminal_torture, criminal_treason, criminal_alcohol, criminal_harmless_error, criminal_guilty_plea, criminal_plea_bargain, criminal_sentencing, criminal_illegal_entry, criminal_acca, criminal_sorna, criminal_mann_act, criminal_fraud_us, criminal_classified, criminal_hacking, criminal_indian_country, criminal_president_threats, criminal_pub_land, criminal_anders

review

Applies the rules of "federal/review.csv".

5 columns: review_district, review_agency, review_immigration, district_text, district_judges

agencies

Applies the rules of "federal/agencies.csv".

1 columns: agencies

federal

Applies the rulebooks of every topic, in order: general, citations, civil, constitutional, criminal, review, agencies.

Every column of the rulebooks above.

header

Finds the parties, their roles, and the judges in the header of a case from a source with no header rules of its own.

53 columns: party1, party2, opening_lines, cite_federal_reporter, cite_fed_appx, cite_westlaw, counsel_us_attorney, counsel_public_defender, disposition_affirm, disposition_reverse, disposition_vacate, disposition_remand, disposition_dismiss, disposition_deny, disposition_enforce, docket_numbers, docket_criminal, docket_civil, party1_cross_appellant, party1_cross_appellee, party1_appellant, party1_appellee, party1_plaintiff, party1_defendant, party1_petitioner, party1_respondent, party1_intervenor, party1_united_states, party2_cross_appellant, party2_cross_appellee, party2_appellant, party2_appellee, party2_plaintiff, party2_defendant, party2_petitioner, party2_respondent, party2_intervenor, party2_united_states, panel_text, panel_judges, authors, concurring, dissenting, opening_united_states, opening_defendant_appellant, opening_defendant_appellee, opening_government_appeals, opening_party_appeals, party1_agencies, party2_agencies, history_agencies, lower_court_num, lower_court_name

courtlistener_header

Finds the parties, their roles, and the judges in a CourtListener case.

56 columns: party1, party2, opening_lines, cite_federal_reporter, cite_fed_appx, cite_westlaw, counsel_us_attorney, counsel_public_defender, disposition_affirm, disposition_reverse, disposition_vacate, disposition_remand, disposition_dismiss, disposition_deny, disposition_enforce, docket_numbers, docket_criminal, docket_civil, party1_cross_appellant, party1_cross_appellee, party1_appellant, party1_appellee, party1_plaintiff, party1_defendant, party1_petitioner, party1_respondent, party1_intervenor, party1_united_states, party2_cross_appellant, party2_cross_appellee, party2_appellant, party2_appellee, party2_plaintiff, party2_defendant, party2_petitioner, party2_respondent, party2_intervenor, party2_united_states, panel_text, panel_judges, authors, concurring, dissenting, opening_united_states, opening_defendant_appellant, opening_defendant_appellee, opening_government_appeals, opening_party_appeals, party1_agencies, party2_agencies, history_agencies, lower_court_num, lower_court_name, caption, caption1, caption2

lexis_nexis_header

Finds the court, the parties, their roles, and the judges in the header of a Lexis-Nexis case.

62 columns: party1, party2, opening_lines, cite_federal_reporter, cite_fed_appx, cite_westlaw, counsel_us_attorney, counsel_public_defender, disposition_affirm, disposition_reverse, disposition_vacate, disposition_remand, disposition_dismiss, disposition_deny, disposition_enforce, docket_numbers, docket_criminal, docket_civil, party1_cross_appellant, party1_cross_appellee, party1_appellant, party1_appellee, party1_plaintiff, party1_defendant, party1_petitioner, party1_respondent, party1_intervenor, party1_united_states, party2_cross_appellant, party2_cross_appellee, party2_appellant, party2_appellee, party2_plaintiff, party2_defendant, party2_petitioner, party2_respondent, party2_intervenor, party2_united_states, panel_text, panel_judges, authors, concurring, dissenting, opening_united_states, opening_defendant_appellant, opening_defendant_appellee, opening_government_appeals, opening_party_appeals, party1_agencies, party2_agencies, history_agencies, lower_court_num, lower_court_name, cite_lexis, future_cert_petition, future_en_banc, future_grant, future_deny, future_remand, notice_unpublished, court_num, court_name

lexis_nexis

Finds the sections of a Lexis-Nexis case of a federal court of appeals.

16 columns: header, opinion, party, court, docket_number, history, future, counsel, notice, dates, disposition, citation, judges, opinion_by, concurring_lines, dissenting_lines