feat(search): add USPTO_PTLITIG docket source#7388
Draft
neilrubin wants to merge 1 commit into
Draft
Conversation
Add a USPTO_PTLITIG source bit to Docket so that dockets contributed from the USPTO Patent Litigation Docket Reports (PTLITIG) can be told apart from RECAP uploads. This follows the precedent of IDB and ANON_2020, where a named external dataset earns its own source value. A new bit is needed rather than reusing RECAP: most PTLITIG cases that lack an existing CourtListener docket are precisely the ones RECAP never captured, so labeling them RECAP would be inaccurate. The source byte was already full (all 256 combinations are enumerated), so this adds the ninth bit (256) and its 256 new combinations to SOURCE_CHOICES, generated the same way the SCANNING_PROJECT bit was layered on. The field is already a SmallIntegerField, so the values 256-511 need no column change -- only the choices -- hence the accompanying migration is a no-op. A matching add_uspto_ptlitig_source() helper and NON_USPTO_PTLITIG_SOURCES() group are added alongside the existing add_*_source helpers, with tests covering the helper and the contiguous source-constant invariant the groups rely on. This is the first of three PRs for the PTLITIG import; on its own it changes no behavior. Refs: freelawproject#664 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This was referenced May 25, 2026
Contributor
|
Thanks for this contribution @neilrubin. I’ve scheduled the review of this and the other three related PRs for our next sprint, which starts on June 9. I took a quick look at the USPTO data and couldn’t find PDFs for the related docket entries. I just want to confirm that this only imports the case and docket entry metadata, but no documents. Is that correct? |
Author
|
Hi @albertisfu, the USPTO dataset is purely PACER docket data (including docket entries) and USPTO matched patent numbers. No PDFs, though obviously CourtListener has a bunch of them. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi — I'm a first-time contributor to CourtListener. I've tried to take on the task of addressing Issue #664, importing PACER data from patent cases collected by the USPTO (the PTLITIG dataset), last updated in 2020. For better or worse, this task touches on some other components of the CL system, and I've broken it into 3 PRs as a result.
First, it seems like the PTLITIG dataset should be treated as a new Docket source value, but the current 8-bit field for such values is full. The first PR switches to a nine-bit source field. Others with a better sense of the big picture might prefer a different solution.
Second, the PTLITIG data identifies the patent(s) at issue in each of the cases. Patent numbers are a very important piece of data in analyzing and making use of patent litigation dockets, and there are other similar well-known identifiers (trademark or copyright registrations come to mind, but there are certainly others) that it would make sense for the CourtListener system to handle and to allow searches on. The second PR adds a database table for such identifiers, currently scoped solely to handle the patent values from PTLITIG. While out of scope for this PR, I would suggest scraping patent numbers from complaints and/or AO120 forms of patent cases to populate this table for more recent cases would be a good follow-on project.
The third PR is the actual ingestion process. The data files to be ingested are available at USPTO. As designed, this seeks to merge all PTLITIG docket entries into the current database, without adding duplicates or disturbing existing entries. Since it is PACER data (some from RECAP and some from the USPTO's own crawl), it includes both docket entries with entry numbers and those without entry numbers (e.g., minute entries). To avoid duplication or difficult merge logic on the minute entries, I chose to not import minute entries at all for items without entry numbers, if there were any existing docket entries for the case in the CL database. The thinking is that cases that currently have docket entries in CL are likely to have dockets at least as complete as those in a 2020 crawl and that minute entries for old cases are of relatively low value anyway, such that they are not worth dealing with the merge logic.
This is one of four PRs that I'm submitting today as a first-time contributor to the repo. While I'm knowledgeable concerning the PACER data, RECAP, and the CL data offerings, and I'm a capable Python coder, I am not intimately familiar with the internals of the repo code. As full disclosure, the code was entirely written using Claude Code, as was the entirety of this .md file, aside from the first six paragraphs of this summary. While I have attempted to carefully think through the design, make sure it is correct and consistent with the existing code, and make sure that it passes all CI tests, this is the work of a first-timer.
I'm aware that FLP has some sort of policies and guidance on the use of tools such as Claude Code for development, but I have not been able to review them. See Issue #7383. To the extent this PR is inconsistent with those policies and guidance, I am happy to revise once I'm able to see them.
Start of LLM-generated PR: This is the first of three small, stacked PRs that add the USPTO Patent
Litigation Docket Reports (PTLITIG) to CourtListener (#664). PTLITIG is a public
USPTO dataset of ~97k U.S. district-court patent cases (1963–2021), compiled by
the USPTO from the same PACER docket reports RECAP captures — so it fits
CourtListener's existing models rather than needing a new pipeline.
I split the work into three PRs to keep each one small and reviewable, and tried
to follow the contributing and database-migration guides (ruff, mypy, FactoryBoy
tests, the migration SQL files). I'd genuinely welcome direction on anything that
isn't idiomatic for the project — especially the design question flagged below.
Opening as a draft for early feedback.
Fixes
Part of #664 ("Incorporate USPTO PACER data"); see also the #448 umbrella for
consolidating bulk PACER sources.
This is PR 1 of 3 for the PTLITIG import. It targets
mainand changes nobehavior on its own. The follow-ups are open now as drafts so you can see the
whole arc:
DocketIdentifiermodel for the asserted patents.import_uspto_ptlitigcommand that performs the ingest.Please merge in order: this PR, then #7389, then #7390.
Summary
Adds a new
Docketsource value,USPTO_PTLITIG, so dockets contributed fromthe USPTO Patent Litigation Docket Reports (PTLITIG) can be distinguished from
RECAP uploads. This follows the precedent of
IDBandANON_2020, where anamed external dataset earns its own source bit.
Why a new bit instead of reusing
RECAP: most PTLITIG cases that lack anexisting CourtListener docket are exactly the ones RECAP never captured, so
marking them
RECAPwould be inaccurate.The
sourcebyte was already full (all 256 combinations are enumerated), sothis adds the ninth bit (
256) and its 256 new combinations toSOURCE_CHOICES,generated the same mechanical way the
SCANNING_PROJECTbit was layered on. Thefield is already a
SmallIntegerField, so values 256–511 need no column change —only the
choices— so the accompanying migration is a no-op. A matchingadd_uspto_ptlitig_source()helper andNON_USPTO_PTLITIG_SOURCES()group areadded alongside the existing
add_*_sourcehelpers, with tests covering thehelper and the contiguous source-constant invariant the group logic relies on.
Question for maintainers before this grows further: this is a large (though
purely mechanical) addition to
docket_sources.py— it doubles the enumeratedSOURCE_CHOICES. The file's own comment notes this should eventually become adjango-bitfield. I'm happy to take that route instead if you'd prefer; flaggingit here rather than guessing.
Deployment
This PR should:
skip-deploy(skips everything below)skip-web-deployskip-celery-deployskip-cronjob-deployskip-daemon-deployThe only change is a no-op
AlterFieldon thesourcefield'schoices; noruntime behavior changes.