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: 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.
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. Values include 'description' of the counta and 'disposed' if available.
- 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)
These functions use parse results to determine additional properties.
- pleas: returns a list of docket minutes containing pleas
- sentence: returns a list of docket minutes containing sentences
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/*
Metadata
Release files for oscn 0.0.0.32
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| oscn-0.0.0.32.tar.gz | 11.3 kB | Without provenance | Details for oscn-0.0.0.32.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| oscn-0.0.0.32-py3-none-any.whl | Python 3 | none | any | Details for oscn-0.0.0.32-py3-none-any.whl |
Total release size: 27.8 kB
Release files / oscn-0.0.0.32.tar.gz
| Download URL | oscn-0.0.0.32.tar.gz |
|---|---|
| Size | 11.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a7c95a459b09eb7c9528b0f401441fdb5cb6652e849fc0d12b6d0c4f1e729fd8
|
|
BLAKE2b-256 checksum How to use checksums |
f3f564822ae901e924ab10e192818a8e82dce3732937763cec4c35db0bf7ab2f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.20.0 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5
|
Release files / oscn-0.0.0.32-py3-none-any.whl
| Download URL | oscn-0.0.0.32-py3-none-any.whl |
|---|---|
| Size | 16.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
37ed902d7b29bb457fea02c4f2ce23847c6d89281defaccbe0b349787c217b02
|
|
BLAKE2b-256 checksum How to use checksums |
0f4574bec15426330577a38c0d963a4cbce8e71a04b5a21b1de706aa6b6985d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.20.0 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5
|
Security for oscn 0.0.0.32
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.