skillfed

courts-db

Database of Courts

courts-db v0.10.27 395.3K downloads/30d#6,982 on PyPI110
Permissive license BSD-2-Clause Active released

What it is and what it does

Courts-DB is a curated open-source database of courts—current and historical—built by the Free Law Project from metadata across millions of case records. It provides two main functions: `find_court()` to look up court identifiers by name string, and `find_court_by_id()` to retrieve full court metadata. The database includes regex patterns for matching court name variations, historical date ranges, jurisdiction levels, case types, and citation strings.

You feed it a court name or identifier and get back structured data: the court's ID, full name, abbreviation, location, system (state/federal/tribal), level (trial/appellate/etc.), bankruptcy status, and URL. Filtering by date and bankruptcy flag lets you disambiguate when multiple courts share similar names—for example, distinguishing the Federal District Court of Massachusetts from its Bankruptcy Court. It has no external runtime dependencies and supports Python 3.9+.

Use it for:

  • Resolve ambiguous court names in legal documents or case filings to their canonical CourtListener identifiers
  • Filter court results by historical date range to find the correct court for cases from specific time periods
  • Identify whether a court reference is a bankruptcy court versus a general district court
  • Build legal research tools that need to normalize and validate court names from user input
  • Populate court metadata (URLs, abbreviations, citation strings) in case management systems

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a searchable database of current and historical courts with string matching, date filtering, and bankruptcy court identification for legal research and case management applications.

Yes. This is a stable, actively maintained package with zero dependencies, permissive licensing, and a clear use case for legal tech and research. Install it if you need reliable court name resolution or court metadata lookup. No known vulnerabilities and low friction make it a safe choice.

Install

courts-db on PyPI

pip

pip install courts-db

uv

uv add courts-db

poetry

poetry add courts-db

Installing courts-db

Before you install

Low friction installation with no runtime dependencies. Actively maintained with recent releases and a stable codebase.

License in practice

BSD-2-Clause is a permissive license; you can use this package freely in commercial and private projects with minimal restrictions.

Quickstart

pip install courts_db

from courts_db import find_court, find_court_by_id

# Look up by ID
result = find_court_by_id("mass")

# Look up by name with filtering
from datetime import datetime as dt
result = find_court(
    "District of Massachusetts",
    bankruptcy=True,
    date_found=dt.strptime("10/02/1975", "%m/%d/%Y")
)

Verify before relying

  • Whether the court data is updated regularly and how currency is maintained
  • Performance characteristics when searching against the full dataset
  • Geographic coverage beyond US courts (if any)

Package facts

License BSD-2-Clause (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 142 days since the last release
Last repo commit
First released
Downloads 395,270/month — #6,982 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: courts_db-0.10.27-py3-none-any.whl

Keywords: courts, legal

Development Status :: 5 - Production/StableIntended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python Modules

Tags

court lookup by namelegal court databasecourt identifier resolverbankruptcy court findercourt string matching
legal-techcourt-data

More Python Modules packages