GithubHelp home page GithubHelp logo

michplunkett / ucpd-incident-reporting Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 38.57 MB

This application makes use of scraped incidents from the UCPD Daily Incident Reports and displays them in a handful of ways.

Home Page: https://total-thinker-381819.uc.r.appspot.com/

License: MIT License

Makefile 0.66% Python 29.39% Procfile 0.21% JavaScript 24.21% HTML 18.04% CSS 27.49%
gcp heroku-deployment police-data python uchicago

ucpd-incident-reporting's People

Stargazers

 avatar

Watchers

 avatar

ucpd-incident-reporting's Issues

Add check for `stored_df` in incident retrieval

What is?

The application currently errors if there are not any stored incidents.

Traceback (most recent call last):
  File "/Users/michaelp/Documents/GitHub/ucpd-incident-reporting/.venv/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/michaelp/Documents/GitHub/ucpd-incident-reporting/.venv/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/michaelp/Documents/GitHub/ucpd-incident-reporting/.venv/lib/python3.11/site-packages/fastapi/applications.py", line 1106, in __call__
    await super().__call__(scope, receive, send)
  File "/Users/michaelp/Documents/GitHub/ucpd-incident-reporting/.venv/lib/python3.11/site-packages/starlette/applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/Users/michaelp/Documents/GitHub/ucpd-incident-reporting/.venv/lib/python3.11/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/Users/michaelp/Documents/GitHub/ucpd-incident-reporting/.venv/lib/python3.11/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/Users/michaelp/Documents/GitHub/ucpd-incident-reporting/.venv/lib/python3.11/site-packages/starlette/middleware/cors.py", line 83, in __call__
    await self.app(scope, receive, send)
  File "/Users/michaelp/Documents/GitHub/ucpd-incident-reporting/.venv/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/Users/michaelp/Documents/GitHub/ucpd-incident-reporting/.venv/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/Users/michaelp/Documents/GitHub/ucpd-incident-reporting/.venv/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in __call__
    raise e
  File "/Users/michaelp/Documents/GitHub/ucpd-incident-reporting/.venv/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in __call__
    await self.app(scope, receive, send)
  File "/Users/michaelp/Documents/GitHub/ucpd-incident-reporting/.venv/lib/python3.11/site-packages/starlette/routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "/Users/michaelp/Documents/GitHub/ucpd-incident-reporting/.venv/lib/python3.11/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/Users/michaelp/Documents/GitHub/ucpd-incident-reporting/.venv/lib/python3.11/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
               ^^^^^^^^^^^^^^^^^^^
  File "/Users/michaelp/Documents/GitHub/ucpd-incident-reporting/.venv/lib/python3.11/site-packages/fastapi/routing.py", line 274, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/michaelp/Documents/GitHub/ucpd-incident-reporting/.venv/lib/python3.11/site-packages/fastapi/routing.py", line 193, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/michaelp/Documents/GitHub/ucpd-incident-reporting/.venv/lib/python3.11/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/michaelp/Documents/GitHub/ucpd-incident-reporting/.venv/lib/python3.11/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/michaelp/Documents/GitHub/ucpd-incident-reporting/.venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/Users/michaelp/Documents/GitHub/ucpd-incident-reporting/.venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/michaelp/Documents/GitHub/ucpd-incident-reporting/incident_reporting/main.py", line 66, in thirty_day_map
    _, types = client.get_last_30_days_of_incidents(True)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/michaelp/Documents/GitHub/ucpd-incident-reporting/incident_reporting/external/google_nbd.py", line 211, in get_last_30_days_of_incidents
    df = self._get_incidents_back_x_days(
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/michaelp/Documents/GitHub/ucpd-incident-reporting/incident_reporting/external/google_nbd.py", line 187, in _get_incidents_back_x_days
    .strftime(UCPD_MDY_KEY_DATE_FORMAT)
     ^^^^^^^^

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.