Py.Cafe

ThomasD21M/

Simple Permit Visualizer

Simple Permit Visualizer

DocsPricing
  • app.py
  • requirements.txt
app.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
from dash import Dash, html, dcc
import pandas as pd
import plotly.express as px

app = Dash(__name__)

# Load dataset
url = "https://raw.githubusercontent.com/plotly/Figure-Friday/refs/heads/main/2025/week-25/Building_Permits_Issued_Past_180_Days.csv"
df = pd.read_csv(url)

# Group and count by workclass
workclass_counts = df.groupby("workclass").size().reset_index(name="Count")

# Create bar chart
fig = px.bar(
    workclass_counts,
    x="workclass",
    y="Count",
    title="Permits Issued by Work Class",
    labels={"workclass": "Work Class", "Count": "Number of Permits"}
)

app.layout = html.Div([
    html.H2("Permits by Work Class", style={"textAlign": "center"}),
    dcc.Graph(figure=fig)
])