Code Monkey home page Code Monkey logo

courtbot-python's People

Contributors

chimchim237 avatar dependabot[bot] avatar ezrinjaz avatar groovecoder avatar hirotochigi avatar jeremiahbrem avatar jgmize avatar jwhitlock avatar kendallcorner avatar maxxcrawford avatar serhazor avatar syk1112 avatar yahyaal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

courtbot-python's Issues

Reach out to non-profits and organizations

About this Issue

We want to continue to expand on the non-profit groups and organizations inside and outside organizations. This issue is to track all the conversations that are happening with the organizations.

Acceptance Criteria

  • Create a issue on this repository with title Contact <org name> as partner
  • Add a label to the issue partnership
  • Add Related to #85 on the body or comment section of the issue
  • Assign yourself on the issue
  • Continue to write notes about the contact, conversations, and need on the issue
  • File a pull request under the /partnership folder as a README summarizing the conversation on the newly created issue (template coming soon)

Expand type of cases for search in OK (courtbot)

About this PR

When CourtBot was spun our first focus was serving the criminal and felony cases for reminders. Since then @jdungan has expanded the oscn package to search more types of cases. We want to expand the the search and setup reminder system to include more types of cases in Oklahoma.

Acceptance Criteria

  • Endpoint to get information on any type of cases
  • Endpoint to send query to search cases

Create a form for text reminder

About this Issue

We would like to have forms be available so that we can help non-profit or individuals add a text reminder for court dates coming up.

Acceptance Criteria

  • Following fields should be available:
    • Case number(s)
    • Phone number (for reminder)
    • Phone number (for other people who wants to be reminded too)

Support date changes

Court dates often move, so it would be good to support checking to see if a date has moved before sending an alert.

If a date moves further into the future, CourtBot can simply re-check the date before sending an alert, and schedule a new reminder, if necessary.

Code for Kentuckiana is working on setting up a stateless proxy to Kentucky court data. In this case, CourtBot could call the proxy with a stored case number (and other necessary info) before sending a previously-scheduled alert. It sounds like CourtBot may need to store some additional info so that it can re-request information before sending out a reminder.

If a date gets moved up, this process won't work, because the alert and check wouldn't be scheduled to occur until the original court date. We should talk to partners in the court system to find out how often this actually happens and what the process is. I feel like there would be an existing notification process in this case, so CourtBot may not need to account for it (or it could be designed in the future).

Add impact of reminders text to Why CourtBot section?

Summary

We should add a big call-out to these studies in the “Why CourtBot?” section of https://courtbot-python.herokuapp.com/

References:

3 quick summary pages showing the impact of text message reminders of court dates on Failure-To-Appear (FTA) and,, in the Tulsa study, Failure-To-Pay (FTP):

Automatic registration

Open Data Delaware would like to discuss the possibility of automatically registering people for courtbot. We understand that this is something that would require coordination with our court system. The way we envision it working is to have a mailer included in the documentation that goes out when a an individual with served with an eviction notice. Then an individual would either out-in to courtbot, opt-out of courtbot, or abstain from courtbot. Once that occurs, the documentation goes back to the court and the court system would enter that information into a system. That data would then be sent to the courtbot team in a csv or either file format and uploaded to the database.

Register .bot domain from Amazon

URL: https://www.amazonregistry.com/bot/validation

.bot domain registration steps:

  1. Find your .BOT domain
  2. Sign into your Amazon account
  3. Validate your published bot
  4. Select registrar and additional services
  5. Complete registration and setup

Validate your published bot:

image

Validation is the process of proving you have access rights to the bot you are using to meet validation requirements. This allows us to keep the .BOT Top Level Domain for bots and retain the domain as a community. Validation associates your bot to a specific validation token if successful. The token is then used to register a .BOT domain name.

To ensure only eligible customers register a .BOT domain name, we need you to validate your bot. Validation tokens are issued to customers who pass validation. The validation token is required to register your .BOT domain name.

Create accounts for dev on AWS

About this Issue

Currently we have one account on the AWS for codefortulsa. Ideally we should create a new account for every person who needs to work on a project in the Code for Tulsa's AWS.

Error while installing the rquirments

I'm getting the following error after running the pip install -r requirements.txt command.

     command: /Users/yahyalazrak/.local/share/virtualenvs/courtbot-python-EtTqZyVo/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/h5/rpyw5_cx1p190fnshr8890640000gn/T/pip-install-nyjpdlht/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/h5/rpyw5_cx1p190fnshr8890640000gn/T/pip-install-nyjpdlht/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
         cwd: /private/var/folders/h5/rpyw5_cx1p190fnshr8890640000gn/T/pip-install-nyjpdlht/psycopg2/
    Complete output (23 lines):
    running egg_info
    creating pip-egg-info/psycopg2.egg-info
    writing pip-egg-info/psycopg2.egg-info/PKG-INFO
    writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
    writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
    writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
    
    Error: pg_config executable not found.
    
    pg_config is required to build psycopg2 from source.  Please add the directory
    containing pg_config to the $PATH or specify the full executable path with the
    option:
    
        python setup.py build_ext --pg-config /path/to/pg_config build ...
    
    or with the pg_config option in 'setup.cfg'.
    
    If you prefer to avoid building psycopg2 from source, please install the PyPI
    'psycopg2-binary' package instead.
    
    For further information please check the 'doc/src/install.rst' file (also at
    <http://initd.org/psycopg/docs/install.html>).
    
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.```

Add an API: GET /eligible-jurisdiction?state=

Step 1 of #42

  • Create an api endpoint returning all the eligible counties Courtbot serves in Oklahoma via an api call /eligible-jurisdiction?state=OK. Response should return:
{
    "jurisdiction_type": "city" | "county" | "ward" | "zip_code" | "state",
    "eligible_juridisdictions": [
        // should be eligible values of the jurisdiction_type
        // e.g. "city" jurisdiction type lists eligible cities "Tulsa", "Muskogee", "Roger" etc
        // "zip_code" jurisdiction type lists eligible zip codes 74133, 74012, 74114
    ]
}
  • Should be able to change the value in state param in the URL to get the state's eligible jurisdictions as mentioned in #40

Epic: finish courtbot

Based on hack night's session, we came up with these major "phases" of building the new courtbot system:

  • Set up Amazon Lex with Twilio and Lambda functions to get Year, County, and Case from the end user.
  • courtbot-python #2 : Add an API call: GET https://courtbot.com/case?year=&county=&case= endpoint finds the case, and responds with the full case object, including the arraignment date.
  • lambda function #15: Call the GET /case? endpoint from the lambda function, and then ask the user to confirm reminders.
  • courtbot-python #3: Add an API call: POST https://courtbot.com/reminders with the case, phone #, and date. courtbot.com creates all reminders for the case.
  • lambda function: When the user confirms the reminders, the lambda function invokes the POST /reminders endpoint
  • courtbot-python: Add cron job to courtbot.com that checks for un-sent reminders and sends them.

IMG_0185

Texts for people who do not yet have court date set

Is there a way for courtbot to activate a user without there being a court date yet? In Delaware we think there may be a possibility of an individual knowing they will have an eviction case number prior to receiving a court hearing date. We would like for this people to be able to activate courtbot texts with their case number and then receive information on their court date when it is updated in the system.

Add multiple case numbers for reminders (courtbot)

About this Issue

Currently we can only fill out one form or message one case number for reminder. We would like to submit multiple cases for reminders to be set for the same number. Use case scenario for this functionality a legal aid organization being reminded for multiple cases which means they will fill out the form on our website with multiple case numbers to create reminders for all of them.
Currently:
Screen Shot 2020-12-08 at 0 08 03
New:
Screen Shot 2020-12-08 at 0 20 04
Screen Shot 2020-12-08 at 0 18 53
note: new button for Add another case and once you click on that we should get another set of fields to provide case information

This may be too big of a ticket and we can split the frontend work to another ticket. If you want to work on just the backend portion to support multtiple case reminder filing please create another issue for the frontend work and mention on the comment in this issue.

event object does not have Docket attribute

I executed Courtbot API at my local environment, and I got an error.
Then, I found that event object does not have Docket attribute.

The below code is a part of api/views.py

@csrf_exempt
def case(request):
    if request.method == 'GET':
        year = request.GET.get('year', 'NOT PROVIDED')
        county = request.GET.get('county', 'NOT PROVIDED')
        case_num = request.GET.get('case_num', 'NOT PROVIDED')

        try:
            case = oscn.request.Case(year=year, county=county, number=case_num)
        except Exception as exc:
            print(exc)
            err_msg = (
                f'Unable to find case with the following information: '
                f'year {year}, county {county}, case number {case_num}')
            return JsonResponse({'error': err_msg})

        arraignment_event = find_arraignment_or_return_False(case.events)
------------------------------------------------------------------------------------------------------
                                                .
                                                . 
                                                .
-------------------------------------------------------------------------------------------------------
def find_arraignment_or_return_False(events):
    for event in events:
        if "arraignment" in event.Docket.lower():
            return event
    return False

The case object is returned from oscn, then its events value goes into the
find_arraignment_or_return_False() method.
Then, events is iterated as event inside the find_arraignment_or_return_False()
However, event object does not have Docket attribute.
The event object has the following attributes.

  1. Amount
  2. Code
  3. Count
  4. Date
  5. Description
  6. Party

Google Chrome Security Warning on Court.Bot

Repro Steps:
_Note_I was using Google Chrome.

  1. Go to google.com
  2. Google "Tulsa court bot"
  3. Click the first result

==Expected==
Safely arrive at court.bot

==Actual==
See a
"Your connection is not private
Attackers might be trying to steal your information from court.bot (for example, passwords, messages, or credit cards). Learn more
NET::ERR_CERT_DATE_INVALID" warning.
Screen Shot 2020-08-31 at 10 00 06 PM

Syntax Error when TWILIO env vars are empty

$ cat .env
export DJANGO_DEBUG=True

export TWILIO_ACCOUNT_SID=
export TWILIO_AUTH_TOKEN=
export TWILIO_FROM_NUMBER=
export TWILIO_TO_NUMBER= #only use for test_twilio.py

$ python3 manage.py runserver
Performing system checks...

Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7f568bf99400>
Traceback (most recent call last):
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/utils/autoreload.py", line 225, in wrapper
    fn(*args, **kwargs)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 117, in inner_run
    self.check(display_num_errors=True)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/core/management/base.py", line 379, in check
    include_deployment_checks=include_deployment_checks,
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/core/management/base.py", line 366, in _run_checks
    return checks.run_checks(**kwargs)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/core/checks/registry.py", line 71, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/core/checks/urls.py", line 40, in check_url_namespaces_unique
    all_namespaces = _load_all_namespaces(resolver)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/core/checks/urls.py", line 57, in _load_all_namespaces
    url_patterns = getattr(resolver, 'url_patterns', [])
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/utils/functional.py", line 37, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/urls/resolvers.py", line 533, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/utils/functional.py", line 37, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/urls/resolvers.py", line 526, in urlconf_module
    return import_module(self.urlconf_name)
  File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 665, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/home/ubuntu/courtbot-python/courtbot/urls.py", line 22, in <module>
    path('sms/', include('sms.urls')),
  File "/home/ubuntu/.local/lib/python3.5/site-packages/django/urls/conf.py", line 34, in include
    urlconf_module = import_module(urlconf_module)
  File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 665, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/home/ubuntu/courtbot-python/sms/urls.py", line 4, in <module>
    from . import views
  File "/home/ubuntu/courtbot-python/sms/views.py", line 23
    resp.message(f'Sorry, I couldn\'t find case {case_num}. Please use a'
                                                                        ^
SyntaxError: invalid syntax

Give the ability to opt out

On the step that asks the user if they want to setup a reminder saying "No" should direct the user to "fulfillment" step.

Contact Open Austin and BASTA as partner

Related to #85
Not sure if this is for your internal team, but I figured it'd be the quickest way to reach y'all. I am formally reaching out to you all on behalf of BASTA and Open Austin.

We have developed a court scraper for the OdysseyPa system which host a large portion of Texas counties court filings. We currently have developed a stable version for Travis County to address our tenant relief/support/organizing efforts in Austin but are moving on to many other counties in Texas to build a system similar to the court.bot statewide.

In the interest of not reinventing any wheels I would like to chat with you all about integrating our systems/data with yours, I am excited to see what we can come up with!

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.