-
Notifications
You must be signed in to change notification settings - Fork 6
/
home.py
55 lines (43 loc) · 2.63 KB
/
home.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import streamlit as st
from PIL import Image
import plotly.graph_objs as go
from year_summary import plot_year_summary
@st.cache()
def load_data():
fname = 'data/cleaned/app_total_number.txt'
with open(fname, 'r') as f:
n_cases = int(f.readline())
return n_cases
def app():
st.image('figures/PBF_logo_edit.png', use_column_width = True)
# year-end summary
fig = plot_year_summary()
f_year = go.FigureWidget(fig)
st.plotly_chart(f_year)
n_cases = load_data()
# What is this app
st.title('Bail in Philadelphia')
st.write("""This dashboard provides a summary of the bail situation in Philadelphia **from January 2020 through March 2021**. A summary of how people in Philadelphia have been impacted by **monetary bail** is displayed at the top of each page. You can also explore how bail breaks down...
- by year: how have **bail types and bail amounts set** in 2021 compared to those set in 2020?
- by actor: how has bail depended on the magistrate or other **person setting bail**?
- by cost to people: how much bail have Philadelphians across the city **paid**?
- by demographics: how has bail differed between **races, genders, and age groups**?
Use the navigation panel on the left to explore.""")
st.write(f"Information from the **{n_cases:,d} cases** used to create this dashboard was gathered from [Philadelphia Municipal Court docket sheets.](https://ujsportal.pacourts.us/DocketSheets/MC.aspx#)")
# What is PBF
st.header('The Philadelphia Bail Fund')
st.write("The Philadelphia Bail Fund is a revolving fund that posts bail for people who are indigent and cannot afford bail.\
Our goal is to keep families and communities together and vigorously advocate for the end to cash bail in Philadelphia. ")
st.subheader("Get involved")
# learn more
pbf_link = 'Learn more at [phillybailfund.org](http://phillybailfund.org)'
st.markdown(pbf_link, unsafe_allow_html = True)
# donate
donation_link = 'Take action via [donation](https://www.phillybailfund.org/donate)'
st.markdown(donation_link, unsafe_allow_html = True)
# contact us
st.markdown('Contact us at <a href="mailto:[email protected]">[email protected]</a>', unsafe_allow_html=True)
# What is Code for Philly
st.header('Code for Philly')
st.write("This dashboard was created by [Code for Philly](https://codeforphilly.org/), a Code For America brigade, in collaboration with the Philadelphia Bail Fund.\
We're part of a national alliance of community organizers, developers, and designers that are putting technology to work in service of our local communities.")