Database of Courts
Project description
Courts-DB
Courts-DB is an open source repository to organize a db of all courts current and historical. It was built for use in Courtlistener.com.
Its main goal is to interface with CL to identify historical and current courts by string. It incldues mechanisms to filter results based on dates and/or whether it is a bankruptcy court.
Further development is intended and all contributors, corrections and additions are welcome.
Background
Free Law Project built this database using the metadata (case names, dates etc.) of over 16 millions data points. This data represents hundreds of hours of research and testing. We believe to be the most extensive open dataset of its kind.
Quickstart
You can feed in a courtlistener Court_ID or string to find a court.
from courts_db import find_court, find_court_by_id find_court_by_id("mass") returns: [{ "regex": [ "${sjc} ${ma}?", "${ma} ${sjc}", "Supreme Court Of ${ma}", "State Of ${ma} Supreme Court" ], "name_abbreviation": "Mass. Sup. Jud. Ct.", "dates": [ { "start": "1692-01-01", "end": null } ], "name": "Massachusetts Supreme Judicial Court", "level": "colr", "case_types": ["All"], "system": "state", "examples": [ "Supreme Court Of Massachusetts", "Supreme Judicial Court Of Massachusetts", "Massachusetts Supreme Judicial Court" ], "court_url": "http://www.mass.gov/courts/sjc/", "type": "appellate", "id": "mass", "location": "Massachusetts", "citation_string": "Mass." }]
from courts_db import find_court mass_sjc = find_court(u"Massachusetts Supreme Judicial Court") returns: ["mass"]
Filtering on less unique strings is built in.
Feed a date string or bankruptcy flag to filter on those parameters For example District of Massachusetts is non unique and returns both the Federal District Court of Massachusetts and its Bankruptcy Court
from datetime import datetime as dt courts_db.find_court( u"District of Massachusetts", ) returns ==> ["mad", "mab"] courts_db.find_court( u"District of Massachusetts", bankruptcy=True, ) returns ==> ["mab"] courts_db.find_court( u"District of Massachusetts", date_found=dt.strptime("10/02/1975", "%m/%d/%Y"), ) returns ==> ["mad"]
Some Notes on the Data
Somethings to keep in mind as you are reviewing the data.
The data is devided into two files courts.json and variables.json
Courts.json holds the bulk of the information
Variables.json holds templates for large numbers of regexes.
Fields
id
==> string; Courtlistener Court Identifiercourt_url
==> string; url for court websiteregex
==> array; regexes patterns to find courtsexamples
==> array; regexes patterns to find courtsname
==> string; full name of the courtname_abbreviation
==> string; court name abbreviationsdates
==> Array; Contains start date, end date and notes on date rangesystem
==> string; Defines main jurisdiction, ex. State, Federal, Triballevel
==> string; code defining where court is in system structure, ex. COLR (Court of Last Resort), IAC (Intermediate Appellate Court), GJC (General Jurisdiction Court), LJC (Limited Jurisdiction Court)location
==> string; refers to the physical location of the main courttype
==> string; Identifies kind of cases handled (Trial, Appellate, Bankruptcy, AG)citation_string
==> string; Identifies the string used in a citation to refer to the court
Installation
Installing courts-db is easy.
pip install courts_db
Or install the latest dev version from github
pip install git+https://github.com/freelawproject/courts-db.git@master
Future
Continue to improve and expand the dataset.
Add filtering mechanisms by state, reporters, citation(s), judges, counties and cities.
Deployment
If you wish to create a new version, the process is:
Update version info in setup.py and commit it.
Tag the commit with the version number.
To proceed manually
Push your commit. CI should take care of the rest.
To proceed manually
Install the requirements in requirements_dev.txt
Set up a config file at ~/.pypirc
Generate a universal distribution that worksin py2 and py3 (see setup.cfg)
python setup.py sdist bdist_wheel
Upload the distributions
twine upload dist/* -r pypi (or pypitest)
License
This repository is available under the permissive BSD license, making it easy and safe to incorporate in your own libraries.
Pull and feature requests welcome. Online editing in Github is possible (and easy!)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file courts-db-0.9.32.tar.gz
.
File metadata
- Download URL: courts-db-0.9.32.tar.gz
- Upload date:
- Size: 74.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 592b64904f7f04070893e5ecb1482d1b10c8c9ea6ffe3d8411679e6bfdc02970 |
|
MD5 | 84743c45aa76a489a4673002c7c9c59d |
|
BLAKE2b-256 | 03f09f993ab24f8e34bed4926d45b80af94aa924ff649cacd3a776346557110b |
File details
Details for the file courts_db-0.9.32-py2.py3-none-any.whl
.
File metadata
- Download URL: courts_db-0.9.32-py2.py3-none-any.whl
- Upload date:
- Size: 82.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58d959da0b6dd70afa2b0fb04a811b90d3e8e3ec4dd2775749a524656752fa64 |
|
MD5 | 243aeb717d10373cc02815b98f374a7a |
|
BLAKE2b-256 | 8141a183c3e232ffb94f4dea1780d56764663afbd19822b7ab1670ffd66d0338 |