Oklahoma Supreme Court Network page parsing utilities
Project description
OSCN Query utilities
This is a collection of python utilities to scrape case information from the Oklahoma Supreme Court Network.
Contents
oscn > Python package source to provide an api for retrieving and parsing case records.
examples > Source HTML files for testing
scripts > Python scripts showing use of the oscn package
- example.py: demostrates use of the request Case and Caselist
- retrieve-counts.py: saves a list of all counts for a list of counties and years
- find-counts.py: saves a list of counts passing a test for a list of counties and years
- soup_test.py: a stub for testing parsing attempts using BeautifulSoup
- parse_test.py: a stub for developing using saved examples
OSCN package
oscn
- counties: Returns a list of counties.
oscn.request
- Case: Returns a single case.
- CaseList: Returns an iterator for retrieving cases for a county and year.
oscn.parse
Parsers accept the html of an OSCN case page and return python objects.
- filed: returns a string of the filing date (e.g. 12/25/2017)
- closed: returns a string of the date the case was closed. Return None if not closed.
- counts: returns of list of counts found in a case
- judge: returns a string of the judge's name
- parties: returns a list of objects that look like this: {'name': 'Some Name', 'type': 'Description'}
- docket: returns a list of rows in a docket
- events: returns a list of rows in the event table
Development Install
- Create and activate a Python 3.6 virtual env
git clone git@github.com:codefortulsa/oscn.gitcd oscnpip install -e .
Usage
Install with pip install oscn
Script example:
import oscn
Request a single case:
oscn.request.Case(county='tulsa', year='2018', number=84)
or request a list of cases to iterate:
oscn.request.CaseList(county='adair', year='2016')
Run test scripts
python scripts/{file.py}
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file oscn-0.0.0.9.tar.gz.
File metadata
- Download URL: oscn-0.0.0.9.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5dc8d0ec46b153c35d5b6f55de9bc35827545b9662002cc2651ccf142c51d3e5
|
|
| MD5 |
85dba358a9366057e46097301614f6cd
|
|
| BLAKE2b-256 |
5ac69cd18e6fa6e3ed858e28037e83a9c568435a6d8bae976bc6a21b9c68c627
|
File details
Details for the file oscn-0.0.0.9-py3-none-any.whl.
File metadata
- Download URL: oscn-0.0.0.9-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f5016cd696c61df68c1613684fe16d1c5af85997b940c719be791bb54c91887
|
|
| MD5 |
f00240c1094178cf903776363767b1a1
|
|
| BLAKE2b-256 |
3d6b7a008af616f5adfe163af6ed30efc6cd60d1b1a7be1bf0e5c129abac1e6b
|