codeforsanjose / courtbot

People need help to not miss a court date. This is a lightweight app for notifications that can be integrated with any county's data.
GNU General Public License v3.0
0 stars 5 forks source link

Evaluate code provided by Tulsa courtbot #2

Closed ying1 closed 2 years ago

ying1 commented 3 years ago

Tulsa: https://court.bot/ Tulsa github: https://github.com/codefortulsa/courtbot-python

schmidtty commented 3 years ago

Courtbot San Jose

image

Courtbot Tulsa Code/Architecture Evaluation

...from the Courtbot Tulsa Playbook:

courtbot 2.0

Build Overview

What’s powering it

How does it work?

      - Text <-> Twilio <-> Lex Lambda <-> OSCN pypi <-> Return same path back
      - Note: OSCN utilities (OSCN pypi) is A python library for scraping case information from the 
        Oklahoma State Courts Network. For more information see [https://pydigger.com/pypi/oscn] 

image

Features

      Current state:
                - Courtbot 2.0 only needs one phone number for everyone to use for 
                  SMS notifications: (844-329-6801)
                - notifications can (also) be received via Facebook and Slack. 
      Future:
                - bulk notification signup via the website.

Implementation

      - you will need an API to plug into courtbot and access a python library that has 
        access to the data OSCN scraper: https://github.com/codefortulsa/oscn
                - oscn > Python package source to provide an API for retrieving and parsing case records
                -  the oscn scraper link has example code that
                     - queries a single case
                     - queries all cases for one county and one year
                     - queries multiple case types, multiple counties or, multiple years
                     - finds a string of text within a case list

Conclusions

      1. the Tulsa solution uses a python library to retrieve the data, sort, find, etc
      2. every query results in a response to the user
      2. other implementations of similar SMS systems use 
         - Amazon Lex (the bot)
         - AWS Lambda (input validation)
         - Amazon DynamoDB (for storing data)        
      3. it might be just sufficient to only store 
         - case_identifier 
         - sms_source_number
         - notification_date
      4. likely main bot functions:
         - bot query based on SMS inputs
         - bot query based on notification_date (# of days before court date)
      5. using AWS seems ideal for non-profits
      6. Costs
         - one instance of courtbot, there are no costs to brigades
         - CfA has access to non-profit credits for Heroku, twilio, AWS
         - Code for Tulsa - has handled hosting costs in the past
      7. not sure where Heroku is being used, possibly SMS/case_number capture page (I'll need to confirm)
ying1 commented 2 years ago

Closing. Thanks for evaluation.