Courts-DB
=========
Courts-DB is an open source repository to organize a database of all courts current and historical.
It was built for use in CourtListener.com.
Its main goal is to interface with CourtListener to identify historical and current courts
by string. It includes 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 this to be the most extensive open dataset of its kind.
Quickstart
===========
You can feed in a CourtListener Court Identifier 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
======================
Some things to keep in mind as you are reviewing the data:
1. The data is divided into two files ``courts.json`` and ``variables.json``.
2. ``courts.json`` holds the bulk of the information.
3. ``variables.json`` holds templates for large numbers of regexes.
Fields
======
1. ``id`` — string; CourtListener Court Identifier
2. ``court_url`` — string; url for court website
3. ``regex`` — array; regexes patterns to find courts
4. ``examples`` — array; regexes patterns to find courts
5. ``name`` — string; full name of the court
6. ``name_abbreviation`` — string; court name abbreviations
7. ``dates`` — Array; contains start date, end date and notes on date range
8. ``system`` — string; defines main jurisdiction, ex. State, Federal, Tribal
9. ``level`` — 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)
10. ``location`` — string; refers to the physical location of the main court
11. ``type`` — string; identifies kind of cases handled (Trial, Appellate, Bankruptcy, AG)
12. ``citation_string`` — string; identifies the string used in a citation to refer to the court
13. ``notes`` — string; a place to put notes about a court
Installation
============
Installing Courts-DB is easy.
::
pip install courts_db
Or install the latest development version from GitHub.
::
pip install git+https://github.com/freelawproject/courts-db.git@master
Future
=======
1. Continue to improve and expand the dataset.
2. Add filtering mechanisms by state, reporters, citation(s), judges, counties and cities.
Deployment
==========
If you wish to create a new version, the process is:
1. Update version info in ``setup.py`` and commit it.
2. Tag the commit with the version number.
To proceed manually
-------------------
1. Push your commit. CI (Continuous Integration) should take care of the rest.
To proceed manually
-------------------
1. Install the requirements in ``requirements_dev.txt``.
2. Set up a config file at ``~/.pypirc``.
3. Generate a universal distribution that works in Python 2 and Python 3 (see ``setup.cfg``).
::
python setup.py sdist bdist_wheel
4. 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!)
Raw data
{
"_id": null,
"home_page": "https://github.com/freelawproject/courts-db",
"name": "courts-db",
"maintainer": "Free Law Project",
"docs_url": null,
"requires_python": null,
"maintainer_email": "info@free.law",
"keywords": "legal, courts",
"author": "Free Law Project",
"author_email": "info@free.law",
"download_url": "https://files.pythonhosted.org/packages/34/8c/09bcbba422b8ba43ebf8dd2227d789d382fd1eae961f594de965224f7037/courts_db-0.10.25.tar.gz",
"platform": null,
"description": "Courts-DB\n=========\n\nCourts-DB is an open source repository to organize a database of all courts current and historical.\nIt was built for use in CourtListener.com.\n\nIts main goal is to interface with CourtListener to identify historical and current courts\nby string. It includes mechanisms to filter results based on dates and/or whether it is a bankruptcy court.\n\nFurther development is intended and all contributors, corrections and additions are welcome.\n\nBackground\n==========\n\nFree Law Project built this database using the metadata (case names, dates etc.)\nof over 16 millions data points. This data represents hundreds of hours of\nresearch and testing. We believe this to be the most extensive open dataset of its kind.\n\nQuickstart\n===========\n\nYou can feed in a CourtListener Court Identifier or string to find a court.\n\n::\n\n from courts_db import find_court, find_court_by_id\n\n find_court_by_id(\"mass\")\n\n returns:\n [{\n \"regex\": [\n \"${sjc} ${ma}?\",\n \"${ma} ${sjc}\",\n \"Supreme Court Of ${ma}\",\n \"State Of ${ma} Supreme Court\"\n ],\n \"name_abbreviation\": \"Mass. Sup. Jud. Ct.\",\n \"dates\": [\n {\n \"start\": \"1692-01-01\",\n \"end\": null\n }\n ],\n \"name\": \"Massachusetts Supreme Judicial Court\",\n \"level\": \"colr\",\n \"case_types\": [\"All\"],\n \"system\": \"state\",\n \"examples\": [\n \"Supreme Court Of Massachusetts\",\n \"Supreme Judicial Court Of Massachusetts\",\n \"Massachusetts Supreme Judicial Court\"\n ],\n \"court_url\": \"http://www.mass.gov/courts/sjc/\",\n \"type\": \"appellate\",\n \"id\": \"mass\",\n \"location\": \"Massachusetts\",\n \"citation_string\": \"Mass.\"\n }]\n\n\n::\n\n from courts_db import find_court\n\n mass_sjc = find_court(u\"Massachusetts Supreme Judicial Court\")\n\n returns: [\"mass\"]\n\n\nFiltering on less unique strings is built in.\n\nFeed a date string or bankruptcy flag to filter on those parameters.\nFor example District of Massachusetts is non unique and returns both the Federal District Court of Massachusetts and its Bankruptcy Court.\n\n::\n\n from datetime import datetime as dt\n\n courts_db.find_court(\n u\"District of Massachusetts\",\n )\n\n returns ==> [\"mad\", \"mab\"]\n\n courts_db.find_court(\n u\"District of Massachusetts\",\n bankruptcy=True,\n )\n\n returns ==> [\"mab\"]\n\n courts_db.find_court(\n u\"District of Massachusetts\",\n date_found=dt.strptime(\"10/02/1975\", \"%m/%d/%Y\"),\n )\n\n returns ==> [\"mad\"]\n\n\nSome Notes on the Data\n======================\nSome things to keep in mind as you are reviewing the data:\n\n1. The data is divided into two files ``courts.json`` and ``variables.json``.\n2. ``courts.json`` holds the bulk of the information.\n3. ``variables.json`` holds templates for large numbers of regexes.\n\nFields\n======\n\n1. ``id`` \u2014 string; CourtListener Court Identifier\n2. ``court_url`` \u2014 string; url for court website\n3. ``regex`` \u2014 array; regexes patterns to find courts\n4. ``examples`` \u2014 array; regexes patterns to find courts\n5. ``name`` \u2014 string; full name of the court\n6. ``name_abbreviation`` \u2014 string; court name abbreviations\n7. ``dates`` \u2014 Array; contains start date, end date and notes on date range\n8. ``system`` \u2014 string; defines main jurisdiction, ex. State, Federal, Tribal\n9. ``level`` \u2014 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)\n10. ``location`` \u2014 string; refers to the physical location of the main court\n11. ``type`` \u2014 string; identifies kind of cases handled (Trial, Appellate, Bankruptcy, AG)\n12. ``citation_string`` \u2014 string; identifies the string used in a citation to refer to the court\n13. ``notes`` \u2014 string; a place to put notes about a court\n\nInstallation\n============\n\nInstalling Courts-DB is easy.\n\n ::\n\n pip install courts_db\n\n\nOr install the latest development version from GitHub.\n\n ::\n\n pip install git+https://github.com/freelawproject/courts-db.git@master\n\n\n\nFuture\n=======\n\n1. Continue to improve and expand the dataset.\n2. Add filtering mechanisms by state, reporters, citation(s), judges, counties and cities.\n\n\nDeployment\n==========\n\nIf you wish to create a new version, the process is:\n\n1. Update version info in ``setup.py`` and commit it.\n\n2. Tag the commit with the version number.\n\nTo proceed manually\n-------------------\n\n1. Push your commit. CI (Continuous Integration) should take care of the rest.\n\n\nTo proceed manually\n-------------------\n\n1. Install the requirements in ``requirements_dev.txt``.\n\n2. Set up a config file at ``~/.pypirc``.\n\n3. Generate a universal distribution that works in Python 2 and Python 3 (see ``setup.cfg``).\n\n ::\n\n python setup.py sdist bdist_wheel\n\n4. Upload the distributions.\n\n ::\n\n twine upload dist/* -r pypi # (or pypitest)\n\n\nLicense\n=======\n\nThis repository is available under the permissive BSD license, making it easy and safe to incorporate in your own libraries.\n\nPull and feature requests welcome. Online editing in GitHub is possible (and easy!)\n",
"bugtrack_url": null,
"license": "BSD",
"summary": "Database of Courts",
"version": "0.10.25",
"project_urls": {
"Homepage": "https://github.com/freelawproject/courts-db"
},
"split_keywords": [
"legal",
" courts"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8eab7dcb8cc2925b159379d54249d5414380cf1fc12d3f46f90936c5aa9af459",
"md5": "27174cc68d26d3f6a75c2b97633588da",
"sha256": "b61783bdee2d7afd549ce767d09b4883d835242f73eab9061e74efc2f19c6f64"
},
"downloads": -1,
"filename": "courts_db-0.10.25-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "27174cc68d26d3f6a75c2b97633588da",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 148158,
"upload_time": "2024-07-24T16:27:53",
"upload_time_iso_8601": "2024-07-24T16:27:53.161126Z",
"url": "https://files.pythonhosted.org/packages/8e/ab/7dcb8cc2925b159379d54249d5414380cf1fc12d3f46f90936c5aa9af459/courts_db-0.10.25-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "348c09bcbba422b8ba43ebf8dd2227d789d382fd1eae961f594de965224f7037",
"md5": "47d2820ccbc44787cc9913618f97655a",
"sha256": "f96b4ef3227e6844b3d2d12970373f2f05cdda66a9f15cbe69527ff66649b9d9"
},
"downloads": -1,
"filename": "courts_db-0.10.25.tar.gz",
"has_sig": false,
"md5_digest": "47d2820ccbc44787cc9913618f97655a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 139256,
"upload_time": "2024-07-24T16:27:55",
"upload_time_iso_8601": "2024-07-24T16:27:55.310798Z",
"url": "https://files.pythonhosted.org/packages/34/8c/09bcbba422b8ba43ebf8dd2227d789d382fd1eae961f594de965224f7037/courts_db-0.10.25.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-24 16:27:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "freelawproject",
"github_project": "courts-db",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "courts-db"
}