courts-db


Namecourts-db JSON
Version 0.10.22 PyPI version JSON
download
home_pagehttps://github.com/freelawproject/courts-db
SummaryDatabase of Courts
upload_time2024-01-09 15:18:35
maintainerFree Law Project
docs_urlNone
authorFree Law Project
requires_python
licenseBSD
keywords legal courts
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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.

1. The data is devided 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. :code:`id` — string; Courtlistener Court Identifier
2. :code:`court_url` — string; url for court website
3. :code:`regex` —  array; regexes patterns to find courts
4. :code:`examples` —  array; regexes patterns to find courts
5. :code:`name` — string; full name of the court
6. :code:`name_abbreviation` — string; court name abbreviations
7. :code:`dates` — Array; Contains start date, end date and notes on date range
8. :code:`system` — string; Defines main jurisdiction, ex. State, Federal, Tribal
9. :code:`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. :code:`location` — string; refers to the physical location of the main court
11. :code:`type` — string; Identifies kind of cases handled (Trial, Appellate, Bankruptcy, AG)
12. :code:`citation_string` — string; Identifies the string used in a citation to refer to the court
13. :code:`notes` — string; A place to put notes about a 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
=======

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.

1. Tag the commit with the version number.

To proceed manually
-------------------

1. Push your commit. CI should take care of the rest.


To proceed manually
-------------------

1. Install the requirements in requirements_dev.txt

1. Set up a config file at ~/.pypirc

1. Generate a universal distribution that worksin py2 and py3 (see setup.cfg)

    ::

        python setup.py sdist bdist_wheel

1. 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": "",
    "maintainer_email": "info@free.law",
    "keywords": "legal,courts",
    "author": "Free Law Project",
    "author_email": "info@free.law",
    "download_url": "https://files.pythonhosted.org/packages/56/81/0c66e04034320ac5ab506ed149a0d0d1c9e7d06c61975774cdb2e43635f2/courts-db-0.10.22.tar.gz",
    "platform": null,
    "description": "Courts-DB\n=========\n\nCourts-DB is an open source repository to organize a db of all courts current and historical.\nIt was built for use in Courtlistener.com.\n\nIts main goal is to interface with CL to identify historical and current courts\nby string.  It incldues 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 to be the most extensive open dataset of its kind.\n\nQuickstart\n===========\n\nYou can feed in a courtlistener Court_ID 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        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======================\nSomethings to keep in mind as you are reviewing the data.\n\n1. The data is devided 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. :code:`id` \u2014 string; Courtlistener Court Identifier\n2. :code:`court_url` \u2014 string; url for court website\n3. :code:`regex` \u2014  array; regexes patterns to find courts\n4. :code:`examples` \u2014  array; regexes patterns to find courts\n5. :code:`name` \u2014 string; full name of the court\n6. :code:`name_abbreviation` \u2014 string; court name abbreviations\n7. :code:`dates` \u2014 Array; Contains start date, end date and notes on date range\n8. :code:`system` \u2014 string; Defines main jurisdiction, ex. State, Federal, Tribal\n9. :code:`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. :code:`location` \u2014 string; refers to the physical location of the main court\n11. :code:`type` \u2014 string; Identifies kind of cases handled (Trial, Appellate, Bankruptcy, AG)\n12. :code:`citation_string` \u2014 string; Identifies the string used in a citation to refer to the court\n13. :code:`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 dev 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\n1. Tag the commit with the version number.\n\nTo proceed manually\n-------------------\n\n1. Push your commit. CI should take care of the rest.\n\n\nTo proceed manually\n-------------------\n\n1. Install the requirements in requirements_dev.txt\n\n1. Set up a config file at ~/.pypirc\n\n1. Generate a universal distribution that worksin py2 and py3 (see setup.cfg)\n\n    ::\n\n        python setup.py sdist bdist_wheel\n\n1. Upload the distributions\n\n    ::\n\n        twine upload dist/* -r pypi (or pypitest)\n\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.22",
    "project_urls": {
        "Homepage": "https://github.com/freelawproject/courts-db"
    },
    "split_keywords": [
        "legal",
        "courts"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bb2b8f54c4a5ba106cc9a74acdd095a0b9d50015e7b0b8dc60bce6a18df6e9de",
                "md5": "af4e4cbf8d417aec837122f575c29cb1",
                "sha256": "f2152826e584e3885baa1fe8e6c98aeb4172462032ce9c9cbcf8abb2d153a42a"
            },
            "downloads": -1,
            "filename": "courts_db-0.10.22-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "af4e4cbf8d417aec837122f575c29cb1",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 147672,
            "upload_time": "2024-01-09T15:18:33",
            "upload_time_iso_8601": "2024-01-09T15:18:33.245186Z",
            "url": "https://files.pythonhosted.org/packages/bb/2b/8f54c4a5ba106cc9a74acdd095a0b9d50015e7b0b8dc60bce6a18df6e9de/courts_db-0.10.22-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "56810c66e04034320ac5ab506ed149a0d0d1c9e7d06c61975774cdb2e43635f2",
                "md5": "199728f94a64ece105803f4d58bedd61",
                "sha256": "65f5bf1fe3e82b368572403097061f2b7b82ee86f11a0bebdff0176bef4e0288"
            },
            "downloads": -1,
            "filename": "courts-db-0.10.22.tar.gz",
            "has_sig": false,
            "md5_digest": "199728f94a64ece105803f4d58bedd61",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 138711,
            "upload_time": "2024-01-09T15:18:35",
            "upload_time_iso_8601": "2024-01-09T15:18:35.095047Z",
            "url": "https://files.pythonhosted.org/packages/56/81/0c66e04034320ac5ab506ed149a0d0d1c9e7d06c61975774cdb2e43635f2/courts-db-0.10.22.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-09 15:18:35",
    "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"
}
        
Elapsed time: 0.17198s