Oklahoma State Courts Network case parsing utilities
Project description
OSCN utilities
A python library for scraping case information from the Oklahoma State Courts Network.
Contents
oscn > Python package source to provide an api for retrieving and parsing case records.
scripts > Python scripts showing use of the oscn package
- example.py: demonstrates 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. Case can be saved as files using Case.save() and retrieved using Case.open().
-
CaseList: Returns an iterator for retrieving cases for a county and year.
CaseLists can be filtered using .find(). See scripts/example.py for details
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 count dicts found in a case. Keys include 'description' of the count. If available 'violation' and 'disposed' are added.
- 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
- attorneys: returns a list of strings found in the attorney table
- issues: returns a list of dicts with issue information. Includes a 'dispositions' key with a list of dicts with disposition details.
oscn.find (experimental)
Calls to the OSCN search application.
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}
Deployment steps
python3 setup.py sdist bdist_wheeltwine upload dist/*
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.42.tar.gz.
File metadata
- Download URL: oscn-0.0.0.42.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eeb1c550207092c185522b3bad1cd5c6cee381ae8faa8b2d7a62a9158f3bd322
|
|
| MD5 |
c38a66e274eb7a301f32699e4c4f6e08
|
|
| BLAKE2b-256 |
fdbfb255f4006e5963807f57aff80a75b8895bf327807b1de064b94c1e22d74a
|
File details
Details for the file oscn-0.0.0.42-py3-none-any.whl.
File metadata
- Download URL: oscn-0.0.0.42-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29ffaa2f0cc23f153d6119efab0f8585875d54add77fff22bdb19d4e8cdf01e5
|
|
| MD5 |
981c0d4e027e85d38c1e0f6f04481e55
|
|
| BLAKE2b-256 |
ecc9c6c3e1d1bf597ac9a7173a788ca8347de022fd0ab32cbf126968e3ca2904
|