Giter Club home page Giter Club logo

oscn's Introduction

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

  1. Create and activate a Python 3.6 virtual env
  2. git clone [email protected]:codefortulsa/oscn.git
  3. cd oscn
  4. pip 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}

oscn's People

Contributors

jdungan avatar kendallcorner avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.