Skip to content

Python wrapper for CAPAPI, liberating federal and state court cases.

Notifications You must be signed in to change notification settings

lethargilistic/wheatonpeters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WheatonPeters

This Python wrapper grants easy access to the CAPAPI provided by the Caselaw Access Project. It liberates state and federal court cases.

Usage

Start by creating a Reporter.

>>>from wheatonpeters import Reporter
>>>wheaton = Reporter()

You can then use your Reporter to make the level API calls and pass in filter arguments. In return, you'll get an object representing the json response.

WheatonPeters adds some useful entries to the top level dictionary, but the results list matches the response from the CAPAPI exactly. WheatonPeters will retrieve up to max_pages API calls and concatenate the results of all of them.

The next and previous links are the cursor links from the last page of the API results. Currently, WheatonPeters only goes forward through results.

>>>response = Reporter.cases(max_pages=5, jurisdiction='alaska', full_case=True, decision_date_min='2001-04-01')
>>>response.keys()
dict_keys(['count', 'results', 'count_included', 'query_url'])
>>>response['count']
1548
>>>response['count_included']
500
>>>response['query_url']
'https://api.case.law/v1/cases/?jurisdiction=alaska&full_case=true&decision_date_min=2001-04-01'
>>>response['results'][0].keys()
dict_keys(['id', 'url', 'name', 'name_abbreviation', 'decision_date', 'docket_number', 'first_page', 'last_page', 'citations', 'volume', 'reporter', 'court', 'jurisdiction', 'casebody'])

TODO

  • cases
  • citations
  • jurisdictions
  • courts
  • volumes
  • reporters
  • bulk

Name

WheatonPeters is named for a legendary Supreme Court case, Wheaton v. Peters, between two Supreme Court reporters that determined that the text of the Court's decisions could not be restricted by copyright.

Platform Support

I only use Linux, and I'm not personally going to test it on anything else.

About

Python wrapper for CAPAPI, liberating federal and state court cases.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages