codefortulsa / courtbot-python Goto Github PK
View Code? Open in Web Editor NEWThis is an experimental reimplementation of courtbot using python.
Home Page: http://court.bot/
License: ISC License
This is an experimental reimplementation of courtbot using python.
Home Page: http://court.bot/
License: ISC License
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.
Contact <org name> as partner
partnership
Related to #85
on the body or comment section of the issue/partnership
folder as a README summarizing the conversation on the newly created issue (template coming soon)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.
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.
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).
We should add a big call-out to these studies in the “Why CourtBot?” section of https://courtbot-python.herokuapp.com/
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):
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.
URL: https://www.amazonregistry.com/bot/validation
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.
Could we consolidate our API calls into a single call from Lambda to courtbot.com? E.g.,
POST /reminders
Host: courtbot.com
year=2019&county=Tulsa&case=12345
Then, we send the confirmation text from courtbot.com instead of from lambda/lex?
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.
Call the GET /case? endpoint from the lambda function, and then ask the user to confirm reminders.
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.```
Step 1 of #42
/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
]
}
state
param in the URL to get the state's eligible jurisdictions as mentioned in #40Step 3 of #1.
Receive case, phone #, and date; creates all reminders for the case.
Based on hack night's session, we came up with these major "phases" of building the new courtbot system:
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.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.POST /reminders
endpointcourtbot-python
: Add cron job to courtbot.com
that checks for un-sent reminders and sends them.Step 2 of #42
eligible_jurisdiction
is city
, county
/ward
, or state
there should be some fuzzy matchingIs 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.
When the lambda function calls /api/reminders within 24 hours of the arraignment date, the current send_alerts
command will never send the reminders.
We should send an error response to the lambda function in this case. Maybe a 420?
Step 1 of #1.
This endpoint finds the case, and responds with the full case object, including the arraignment date
test
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:
New:
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.
Step 6 of #1
Repro steps:
==Expected==
I am taken to www.oscn.net/dockets/search.aspx
==Actual==
I am taken to http://court.bot/“www.oscn.net/dockets/search.aspx” and get a 404.
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.
Issues:
Repro Steps:
_Note_I was using Google Chrome.
==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.
As pointed out by @jgmize, we should use get_or_create
instead of create
to prevent creating duplicate reminders.
#50 (comment)
Code for Kentuckiana suggested we should have brigades stand up API endpoints that return a list of their counties.
$ 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
On the step that asks the user if they want to setup a reminder saying "No" should direct the user to "fulfillment" step.
When setting up reminder for a specific case, the year is hard coded to 2018
instead of getting it from the case number/id
https://github.com/codefortulsa/courtbot-python/blob/master/sms/views.py#L29
It is always handled as a string anyway.
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!
Or whatever reason the code here is old. Please fix so people can contribute.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.