A detailed Streamlit based primer on the U.S. Congress.
To upload files, please first save the app
import streamlit as st
import pandas as pd
import plotly.graph_objects as go
st.title("U.S. Congress Primer")
# Introduction text
st.write("Welcome to the U.S. Congress Primer! This application provides detailed information about the structure and function of the United States Congress.")
# Structure of Congress
st.header("Structure of Congress")
st.write("The U.S. Congress consists of two chambers: the Senate and the House of Representatives.")
# Define important constants
SENATE_SEATS = 100
HOUSE_SEATS = 435
# Display basic information
st.write(f"Total seats in the Senate: {SENATE_SEATS}")
st.write(f"Total seats in the House of Representatives: {HOUSE_SEATS}")
# Senate details
st.subheader("Senate")
st.write("The Senate is composed of 100 senators, two from each state, serving staggered six-year terms.")
# Create a pie chart for Senate composition
senate_data = [50, 50] # Example for 50 Democrats and 50 Republicans
fig_senate = go.Figure(data=[go.Pie(labels=["Democrats", "Republicans"], values=senate_data)])
fig_senate.update_layout(title="Senate Composition")
st.plotly_chart(fig_senate, use_container_width=True)
# House details
st.subheader("House of Representatives")
st.write("The House has 435 members, with the number from each state based on its population.")
# Create a bar chart for House composition
house_data = [222, 213] # Example for 222 Democrats and 213 Republicans in the House
fig_house = go.Figure(data=[go.Bar(x=["Democrats", "Republicans"], y=house_data)])
fig_house.update_layout(title="House Composition", xaxis_title="Party", yaxis_title="Number of Representatives")
st.plotly_chart(fig_house, use_container_width=True)
# Legislative process
st.header("Legislative Process")
st.write("The legislative process is the procedure by which laws are enacted in the U.S. Congress.")
st.subheader("Steps in the Legislative Process:")
st.write("1. Proposal of Legislation\n2. Committee Review\n3. Floor Debate and Voting\n4. Conference Committee\n5. Presidential Action")
# Conclusion
st.header("Conclusion")
st.write("Understanding the U.S. Congress is crucial for comprehending how laws are made and governance is conducted. This primer has provided a brief overview of its structure and the legislative process.")
# Resources
st.subheader("Further Reading")
st.write("1. [U.S. Government Publishing Office: Congress](https://www.congress.gov/)\n2. [C-SPAN: Congress](https://www.c-span.org/)\n3. [Library of Congress: Congress Overview](https://www.loc.gov/item/95-148983/)")
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?