Repository navigation
Release: 0.1.0
All notable changes to this project will be documented in this file.
0.1.0
The first release, and the first on PyPI. It is a complete rewrite of the
earlier, unreleased CourtPy, which was built on siMpLify. The analysis is now
done with amos (and its workflows
with chrisjen). The changes below
are from that earlier code.
Added
- Downloads from CourtListener, now the main source of opinions:
BulkDataextracts cases from CourtListener's quarterly bulk data, which
needs no API key and has no limits. It downloads the files (resuming an
interrupted download) or streams them.CourtListenerdownloads cases with the REST API (version 4). It spaces
its requests, waits when CourtListener asks it to, and saves its place so
that a download stopped by an account's limit resumes where it stopped.- Both save each case as a JSON file, which
courtlistener.read_casereads.
CourtListener's header information comes from its data, so no rules are
needed to find it.
courtpy.secretskeeps the CourtListener API key outside of any project:
in the system keyring, in a private file in the user's configuration folder,
in theCOURTLISTENER_API_KEYenvironment variable, or in a.envfile.- A single rule engine (
RuleandRulebook) for every CSV file of rules,
with one set of columns (target,variable,kind,pattern,value,
ignorecase,dotall, andnote) and nine kinds of rules. See
src/courtpy/instructions/README.md. - The coders
code_parties,code_case_type,code_outcome, anddrop_text,
which areamostechniques and can be named in anyamossettings. courtpy.Project, anamos.Projectwhose "cases" section collects, parses,
and codes the cases before the analysis.- The
courtpycommand (key,download,split,parse,rules, and
run). - Tests, and an example study (
examples/federal_appeals.ini). - The parts of the snickerdoodle
template: GitHub Actions (tests on Linux, macOS, and Windows with Python
3.11 to 3.14, linting, type checking, documentation deployed to GitHub
Pages, releases, publishing to PyPI, and validating the Codecov settings),
dependabot, issue templates, pre-commit hooks, an editor configuration, a
code of conduct, a contribution guide, and documentation built with MkDocs
(a tutorial, an advanced user guide, a guide to writing rules, recipes, and
the API reference).
Changed
- The package uses a
srclayout and is built with hatchling and uv. - The old instruction files were converted to the new columns:
organizer_lexis_nexis.csvandseparate_opinions.csvbecame
lexis_nexis.csv,keywords_federal.csvbecamefederal/header.csv, and
parser_opinions_federal.csvbecamefederal/opinion.csv(and is now
saved in UTF-8). Some variables were renamed to be easier to read, such as
party_appnt1toparty1_appellant,counsel_us_attyto
counsel_us_attorney,notice_unpub_ruletonotice_unpublished, and
disposition_op_reversedtoopinion_reverse. - A decision is coded as a reversal from its stated disposition when it has
one, and only otherwise from the opinion's words. (Before, either one was
enough, so "we will not reverse" in an affirmed case counted as a
reversal.) - Which party won an appeal is now coded from the party's role: an appellant
wins a reversal, and an appellee wins an affirmance. (The old code had the
two reversed.) Outcomes that cannot be known are missing values rather than
false. - Judges' names are split at whole words only, so names such as "Kirby" and
"Holland" are no longer cut at "BY" and "AND".
Fixed in the rules
Fed_App_P,Fed_Civ_P,Fed_Crim_P, andFed_Evidrequired a "§" sign,
which is not used when federal rules are cited, so they never matched. The
evidence rule's pattern was also malformed.references_casenow includes the Federal Reporter, Fourth Series (F.4th).amend8searched for the Seventh Amendment's numeral ("VII").titleviirequired the text "Title VII.," followed by a space.alcoholsearched for "ddistilled".- The opinion's dispositions (
opinion_reverse,opinion_vacate,
opinion_remand, andopinion_dismiss) only matched "We willreverse" (with
no space) or a capitalized "Dismiss". - The variables
criminal_manslaugtherandgeneral_aritcleivare now
criminal_manslaughterandgeneral_articleiv. - Non-breaking spaces in patterns now match any space.
- Lexis-Nexis header sections that end the header (such as a "JUDGES:"
paragraph just before "OPINION") are now found. - Agencies are matched from the longest name down, so "Postal Service Board of
Contract Appeals" is no longer labeled "Postal Service".
Removed
- The siMpLify-based modules (
almanac,cookbook,entities,implements,
cases.py, andcontroller.py) and the settings files that went with them. - The
federal_archiveinstruction files, which the combined files had
replaced. - The external data used to add judges' biographies and political context is
kept inreference/, but is not yet used by the new version.