AMD Earnings Trend Analyzer

Build an interactive dashboard analyzing AMD's earnings with SEC EDGAR data.

Introduction

30 Second Summary

Every quarter, companies report their earnings and investors scramble to understand the numbers. Analysts spend hours turning raw financial data into clear trend stories that drive decisions.

In this project, you will build an interactive earnings dashboard that analyzes AMD's quarterly financial trajectory. You will pull real data from the SEC's free API to visualize how AMD transformed into an AI infrastructure company.

What You'll Build

An interactive Streamlit dashboard that fetches financial data from the SEC EDGAR API, calculates growth metrics, and presents AMD's multi-quarter earnings story through professional KPI cards and Plotly charts.

By the end of this project, you'll have:

  • A working SEC EDGAR data pipeline that programmatically fetches real financial data from the SEC's free XBRL API.
  • A live, interactive Streamlit dashboard with professional KPI cards and interactive Plotly charts analyzing AMD's multi-quarter earnings.
  • A deployed portfolio artifact on Streamlit Community Cloud with a shareable URL for LinkedIn.
  • Secret Mission: Add a YoY comparison toggle and downloadable CSV export for the underlying data.

Are there any prerequisites?

You should have basic Python knowledge covering variables, functions, loops, and dictionaries. No prior experience with financial data or dashboards is needed.

Set Up Your Project Environment

Before you can build the AMD earnings dashboard, you need a clean workspace with the right tools installed.

In this step, you will create an isolated Python project folder, install Streamlit (the framework that turns Python scripts into interactive web apps) and Plotly (the charting library), and confirm everything works.

In this step, get ready to:
  • Create a project folder and Python virtual environment.
  • Install Streamlit and Plotly.
  • Verify the installation and create your project files.
Create a project folder and Python virtual environment

A virtual environment gives your project its own private set of Python packages. This prevents conflicts between projects that need different library versions.

  • Press Cmd+Space (macOS) or the Windows key (Windows) to open your search bar.
  • Type VS Code and press Enter to open it.
  • Open the integrated terminal by pressing Ctrl+` (backtick key, located above Tab). You can also click Terminal in the top menu bar, then New Terminal.
  • Move to your Desktop by running this command:
cd ~/Desktop
  • Create your project folder and move into it by running these commands:
mkdir amd-earnings-analyzer
cd amd-earnings-analyzer
  • Create your Python virtual environment by running:
python -m venv venv

What does this command do?

python -m venv venv tells Python to create a virtual environment in a folder called venv. All packages you install next will live in this folder, completely separate from your system Python.

  • Activate the virtual environment by running the command for your operating system:

macOS

source venv/bin/activate

Windows

venv\Scripts\activate
  • Check your terminal prompt. You should see (venv) at the beginning of the line. This confirms the virtual environment is active.

Don't see (venv) in your prompt?

On macOS, make sure you used source before the path. On Windows, if you get a permissions error, run this first:

Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned

Then try the activate command again.

If python -m venv venv failed earlier, try python3 -m venv venv instead (some macOS setups require python3).

Help me activate my Python virtual environment.

Install the required packages
  • With your virtual environment active, install Streamlit and Plotly by running:
pip install streamlit==1.58.0 plotly

What about pandas and requests?

You will use pandas for data manipulation and requests for API calls later in this project. Both are installed automatically as Streamlit dependencies, so you do not need to install them separately.

  • Wait for the installation to finish. You should see a message listing streamlit, plotly, and their dependencies as successfully installed.

Installation failed?

Make sure you see (venv) in your terminal prompt. If you don't, the virtual environment is not active and pip may be pointing to a different Python installation.

If you see a network timeout, check your internet connection and try the command again.

Help me fix my pip install error.

Verify the installation and create project files
  • Verify Streamlit installed correctly by running its built-in demo:
streamlit hello
  • A browser tab should open automatically with Streamlit's demo app. This confirms Streamlit is working.
  • Return to your terminal and press Ctrl+C to stop the demo server.

Browser didn't open?

Check your terminal output for a URL (usually starting with http://localhost:8501). Copy and paste that URL into your browser manually.

If you see a "command not found" error, your virtual environment may not be active. Re-run the activation command from the previous substep.

Help me get streamlit hello working.

Now you will create the two files your project needs.

  • Create your main app file and requirements file by running:

macOS

touch streamlit_app.py
touch requirements.txt

Windows

New-Item streamlit_app.py
New-Item requirements.txt
  • Confirm the files exist by running:
ls
  • You should see streamlit_app.py, requirements.txt, and the venv folder in the output.
  • Open your project folder in VS Code by clicking File in the top menu bar.
  • Click Open Folder.
  • Navigate to your Desktop, select the amd-earnings-analyzer folder, and click Open.
  • In the Explorer sidebar (left panel), click on requirements.txt to open it.
  • Add the following content to list your project's dependencies:
streamlit==1.58.0
plotly

Why pin Streamlit's version?

Pinning streamlit==1.58.0 ensures your app deploys with the exact same version you developed against. This prevents unexpected breakage when Streamlit releases a new version.

  • Save requirements.txt by pressing Cmd+S (macOS) or Ctrl+S (Windows).

✔️ Awesome, I've got everything!

Great. Double check you have saved your file.

ⓧ I'd like to double check the full code

Here is the complete requirements.txt file:

streamlit==1.58.0
plotly

Your environment is ready. Next up, you will build a data pipeline that pulls real financial data from the SEC EDGAR API, the same source Wall Street analysts use.

Build the SEC EDGAR Data Pipeline

Your environment is ready with Streamlit and Plotly installed. Now it is time to build the data engine that powers your dashboard.

Every financial dashboard starts with a data pipeline. Yours will pull real company data from the SEC EDGAR API (the same free source Wall Street analysts use) and structure AMD's quarterly earnings into a clean pandas DataFrame ready for visualization.

In this step, get ready to:
  • Connect to the SEC EDGAR XBRL API and fetch AMD's financial facts.
  • Structure AMD's quarterly revenue by segment into a pandas DataFrame.
  • Calculate derived metrics like YoY growth and revenue mix percentages.
Set up the page config and SEC EDGAR fetch function

Streamlit apps start with a page configuration that sets the browser tab title, icon, and layout. You will also create your first pipeline function that talks directly to the SEC's free XBRL API.

  • In VS Code, open streamlit_app.py from the Explorer sidebar.
  • Paste the following imports and page configuration at the top of the file:
import streamlit as st
import plotly.graph_objects as go
import pandas as pd
import requests
import time

# --- PAGE CONFIG ---
# Set browser tab title, icon, and use full page width
st.set_page_config(
    page_title="AMD Earnings Trend Analyzer",
    page_icon="\ud83d\udcc8",
    layout="wide",
)

What does this code do?

The five imports bring in your core toolkit: streamlit for the web app framework, plotly.graph_objects for interactive charts, pandas for data manipulation, requests for HTTP calls, and time for rate limiting.

The st.set_page_config() call configures the browser tab. Setting layout="wide" uses the full browser width, which gives your charts and KPI cards room to breathe.

  • Below the page config, add the function that fetches AMD's data from the SEC EDGAR XBRL API:
# --- SEC EDGAR DATA PIPELINE ---
@st.cache_data(ttl=86400)
def fetch_sec_edgar_facts():
    # SEC EDGAR XBRL API endpoint for AMD (CIK 0000002488)
    url = "https://data.sec.gov/api/xbrl/companyfacts/CIK0000002488.json"
    # SEC requires a descriptive User-Agent header with contact info
    headers = {
        "User-Agent": "AMDEarningsAnalyzer contact@example.com",
        "Accept-Encoding": "gzip, deflate",
    }
    try:
        response = requests.get(url, headers=headers)
        # Respect SEC rate limit of 10 requests per second
        time.sleep(0.12)
        if response.status_code == 200:
            data = response.json()
            return {
                "entity_name": data.get("entityName", "N/A"),
                "cik": data.get("cik", "N/A"),
                "facts_available": len(data.get("facts", {}).get("us-gaap", {})),
            }
    except requests.exceptions.RequestException:
        pass
    return None

What does this function do?

This function makes a GET request to the SEC's free XBRL API using AMD's CIK number (0000002488). The SEC requires every request to include a User-Agent header identifying your app and a contact email. Without it, your request gets rejected.

The @st.cache_data(ttl=86400) decorator caches the response for 24 hours (86400 seconds). This means your app only hits the SEC API once per day, even if multiple users load the dashboard.

The time.sleep(0.12) call pauses for 120 milliseconds after each request to stay within the SEC's rate limit of 10 requests per second.

  • Save streamlit_app.py.

You will not see any output yet since the function is only defined, not called.

Seeing a red underline on imports?

If VS Code shows import errors, make sure your Python interpreter is set to the venv environment. Press Cmd+Shift+P (macOS) or Ctrl+Shift+P (Windows), type Python: Select Interpreter, and choose the one with venv in the path.

help me fix import errors in my Streamlit project

Create the quarterly earnings data function

Parsing raw XBRL JSON is complex because it includes year-to-date values, restatements, and multiple taxonomies. Real analysts supplement API data with curated datasets from press releases. Your function will return a clean DataFrame sourced from AMD's official earnings press releases.

  • Below the fetch_sec_edgar_facts() function, add the quarterly data function:
def get_amd_quarterly_data():
    # AMD quarterly revenue by segment (in millions USD)
    # Source: AMD official earnings press releases (SEC 8-K filings)
    data = {
        "Quarter": ["Q1'24", "Q4'24", "Q1'25", "Q4'25", "Q1'26"],
        "Data Center": [2337, 3859, 3674, 5380, 5775],
        "Client": [1368, 2313, 2294, 3097, 2885],
        "Gaming": [922, 563, 647, 843, 720],
        "Embedded": [846, 923, 823, 950, 873],
        "Total Revenue": [5473, 7658, 7438, 10270, 10253],
        "Non-GAAP EPS": [0.62, 1.09, 0.96, 0.92, 1.37],
    }
    return pd.DataFrame(data)

What does this data represent?

Each row is one fiscal quarter of AMD's earnings, from Q1 2024 through Q1 2026. The four revenue segments (Data Center, Client, Gaming, Embedded) show where AMD's money comes from.

The Data Center column tells the biggest story: revenue grew from $2,337M to $5,775M across these 5 quarters. That is the AI infrastructure boom in raw numbers.

  • Save streamlit_app.py.

You won't see a change yet. The next chunk calls these functions and displays the results.

Calculate derived metrics and test the pipeline

Raw revenue numbers are useful, but analysts need derived metrics like year-over-year growth and revenue mix to spot trends. Your final function will calculate these, then you will wire everything together and run the app.

  • Below the get_amd_quarterly_data() function, add the metrics calculation function:
def calculate_metrics(df):
    # Calculate YoY growth for quarters where prior year data exists
    df["DC YoY Growth %"] = None
    # Q1'25 vs Q1'24
    df.loc[df["Quarter"] == "Q1'25", "DC YoY Growth %"] = round(
        (3674 - 2337) / 2337 * 100, 1
    )
    # Q1'26 vs Q1'25
    df.loc[df["Quarter"] == "Q1'26", "DC YoY Growth %"] = round(
        (5775 - 3674) / 3674 * 100, 1
    )
    # Revenue mix shows Data Center's share of total revenue
    df["DC Mix %"] = round(df["Data Center"] / df["Total Revenue"] * 100, 1)
    return df

What does this function do?

YoY (year-over-year) growth compares the same quarter across two years. The function only calculates growth for Q1'25 and Q1'26 because those are the quarters with matching prior-year data (Q1'24 and Q1'25 respectively).

The DC Mix % column divides Data Center revenue by total revenue. This reveals how AMD's revenue composition is shifting toward data center products.

  • Now add the code that calls all three functions and displays the raw data. Paste this below calculate_metrics:
# --- LOAD DATA ---
df = get_amd_quarterly_data()
df = calculate_metrics(df)
sec_info = fetch_sec_edgar_facts()

st.dataframe(df)

What does this section do?

This is the script's main body. It calls your three functions in sequence: build the DataFrame, enrich it with calculated metrics, and fetch the SEC connection info. The st.dataframe(df) call renders an interactive table in the browser so you can verify the data looks correct.

  • Save streamlit_app.py.
  • Run the app by entering this command in your terminal:
streamlit run streamlit_app.py

A browser tab opens with an interactive table showing 5 rows of AMD quarterly data. You should see columns for Quarter, each segment's revenue, Total Revenue, Non-GAAP EPS, DC YoY Growth %, and DC Mix %.

Browser tab did not open?

Make sure your virtual environment is active (you should see (venv) in your terminal prompt). If you see streamlit: command not found, reactivate the environment by running venv\Scripts\activate (Windows) or source venv/bin/activate (macOS).

If you see a connection error for the SEC API, that is fine. The fetch_sec_edgar_facts() function handles failures gracefully and returns None. The DataFrame will still display.

help me troubleshoot why my Streamlit app is not running

✔️ Awesome, I've got everything!

Great. Double check you have saved streamlit_app.py and that the table is displaying in your browser.

ⓧ I'd like to double check the full code

Here is the complete streamlit_app.py at this point:

import streamlit as st
import plotly.graph_objects as go
import pandas as pd
import requests
import time

# --- PAGE CONFIG ---
st.set_page_config(
    page_title="AMD Earnings Trend Analyzer",
    page_icon="\ud83d\udcc8",
    layout="wide",
)

# --- SEC EDGAR DATA PIPELINE ---
@st.cache_data(ttl=86400)
def fetch_sec_edgar_facts():
    url = "https://data.sec.gov/api/xbrl/companyfacts/CIK0000002488.json"
    headers = {
        "User-Agent": "AMDEarningsAnalyzer contact@example.com",
        "Accept-Encoding": "gzip, deflate",
    }
    try:
        response = requests.get(url, headers=headers)
        time.sleep(0.12)
        if response.status_code == 200:
            data = response.json()
            return {
                "entity_name": data.get("entityName", "N/A"),
                "cik": data.get("cik", "N/A"),
                "facts_available": len(data.get("facts", {}).get("us-gaap", {})),
            }
    except requests.exceptions.RequestException:
        pass
    return None


def get_amd_quarterly_data():
    data = {
        "Quarter": ["Q1'24", "Q4'24", "Q1'25", "Q4'25", "Q1'26"],
        "Data Center": [2337, 3859, 3674, 5380, 5775],
        "Client": [1368, 2313, 2294, 3097, 2885],
        "Gaming": [922, 563, 647, 843, 720],
        "Embedded": [846, 923, 823, 950, 873],
        "Total Revenue": [5473, 7658, 7438, 10270, 10253],
        "Non-GAAP EPS": [0.62, 1.09, 0.96, 0.92, 1.37],
    }
    return pd.DataFrame(data)


def calculate_metrics(df):
    df["DC YoY Growth %"] = None
    df.loc[df["Quarter"] == "Q1'25", "DC YoY Growth %"] = round(
        (3674 - 2337) / 2337 * 100, 1
    )
    df.loc[df["Quarter"] == "Q1'26", "DC YoY Growth %"] = round(
        (5775 - 3674) / 3674 * 100, 1
    )
    df["DC Mix %"] = round(df["Data Center"] / df["Total Revenue"] * 100, 1)
    return df


# --- LOAD DATA ---
df = get_amd_quarterly_data()
df = calculate_metrics(df)
sec_info = fetch_sec_edgar_facts()

st.dataframe(df)

Your data pipeline is live. Next up, you will replace this raw table with professional KPI cards and a polished dashboard layout.

Build the Dashboard Layout with KPI Cards

Your data pipeline works and the raw DataFrame proves it. But a table of numbers is not a dashboard.

In this step, you will transform that raw output into a professional layout with headline metrics, interactive filtering, and a structure ready for charts. This is the same pattern real analysts use to surface key insights at a glance.

In this step, get ready to:
  • Replace the raw DataFrame with a professional header and KPI cards.
  • Add a time range filter that controls which quarters appear in the dashboard.
  • Set up a two-column layout for charts in the next step.
Replace the raw DataFrame with a header and KPI cards

Dashboards lead with the most important numbers. st.metric() displays a value in large bold text with an arrow indicating change from a prior period.

  • In streamlit_app.py, find the line at the bottom that says:
st.dataframe(df)
  • Delete that line entirely.
  • In its place, add the following header section:
# --- HEADER ---
st.title("AMD Earnings Trend Analyzer")
st.markdown(
    "Tracking AMD's transformation into an AI infrastructure company. "
    "Data Center revenue doubled from $2.3B to $5.8B in 8 quarters."
)

if sec_info:
    st.caption(
        f"SEC EDGAR connected: {sec_info['entity_name']} | "
        f"CIK: {sec_info['cik']} | "
        f"{sec_info['facts_available']} XBRL facts available"
    )

st.divider()

What does this code do?

st.title() renders a large heading at the top of the page. st.markdown() adds a subtitle that frames the narrative for viewers.

The if sec_info: block conditionally shows a caption proving the SEC EDGAR API connection is live. If the API is unreachable, it gracefully skips this line instead of crashing.

  • Directly below the divider, add the KPI cards section:
# --- KPI CARDS ---
latest = df.iloc[-1]
prior_year = df[df["Quarter"] == "Q1'25"].iloc[0]

col1, col2, col3, col4 = st.columns(4)
with col1:
    st.metric(
        label="Total Revenue",
        value=f"${latest['Total Revenue'] / 1000:.1f}B",
        delta=f"{((latest['Total Revenue'] - prior_year['Total Revenue']) / prior_year['Total Revenue'] * 100):.0f}% YoY",
    )
with col2:
    st.metric(
        label="Data Center Revenue",
        value=f"${latest['Data Center'] / 1000:.1f}B",
        delta=f"{latest['DC YoY Growth %']:.0f}% YoY",
    )
with col3:
    st.metric(
        label="DC Revenue Mix",
        value=f"{latest['DC Mix %']:.0f}%",
        delta=f"+{latest['DC Mix %'] - df[df['Quarter'] == 'Q1\\'24'].iloc[0]['DC Mix %']:.0f} ppts vs Q1'24",
    )
with col4:
    st.metric(
        label="Non-GAAP EPS",
        value=f"${latest['Non-GAAP EPS']:.2f}",
        delta=f"+${latest['Non-GAAP EPS'] - prior_year['Non-GAAP EPS']:.2f} vs Q1'25",
    )

st.divider()

What does this code do?

latest = df.iloc[-1] grabs the most recent quarter (Q1'26). prior_year grabs Q1'25 so you can compute year-over-year changes.

st.columns(4) creates four equal-width columns. Each st.metric() call displays a label, a formatted value, and a delta showing the change. Positive deltas render with a green up-arrow automatically.

  • Save streamlit_app.py.
  • Return to your terminal and run the app:
streamlit run streamlit_app.py
  • You should see a title, subtitle, and four KPI cards showing $10.3B total revenue, $5.8B Data Center revenue, 56% DC mix, and $1.37 EPS with green delta arrows.

Cards showing NaN or errors?

Make sure your calculate_metrics() function from the previous step is called before the header section. The KPI cards rely on the DC YoY Growth % and DC Mix % columns existing in the DataFrame.

help me debug NaN values in my Streamlit KPI cards

Add a time range filter

Interactive widgets are what separate a static report from a dashboard. A dropdown filter lets viewers control which quarters they see.

  • Below the second st.divider() (after the KPI cards), add the filter section:
# --- FILTER ---
time_range = st.selectbox(
    "Time Range",
    ["Last 3 Quarters", "Last 5 Quarters (All)"],
    index=1,
)

if time_range == "Last 3 Quarters":
    filtered_df = df.tail(3)
else:
    filtered_df = df

What does this code do?

st.selectbox() renders a dropdown widget. The index=1 parameter sets the default selection to the second option (all 5 quarters).

When a viewer picks a different option, Streamlit reruns the script from top to bottom. The filtered_df variable captures whichever subset was chosen. Charts in the next step will reference this variable to display only the selected quarters.

  • Save streamlit_app.py and check your browser.
  • You should see a Time Range dropdown below the KPI cards, defaulting to "Last 5 Quarters (All)".

Dropdown not appearing?

Make sure the filter code is placed after the second st.divider() and not inside any with col: block. Widgets placed inside a column context only render within that column.

help me figure out why my Streamlit selectbox is not showing

Set up the two-column chart layout

The next step will fill these columns with Plotly charts. For now, you are creating the structural skeleton so the layout is ready.

  • Below the filter section, add the chart placeholder layout:
# --- CHART PLACEHOLDERS ---
left_col, right_col = st.columns([2, 1])

What does this code do?

st.columns([2, 1]) creates two columns with a 2:1 width ratio. The left column gets twice the space, perfect for a wide trend chart. The right column is narrower, ideal for a compact donut chart.

  • Save streamlit_app.py and confirm the app still runs without errors.
  • You will not see a visible change yet because the columns are empty. The next step fills them with interactive charts.

✔️ Awesome, I've got everything!

Great. Double check you have saved streamlit_app.py and that the app runs without errors.

ⓧ I'd like to double check the full code

Here is the complete streamlit_app.py at the end of this step:

import streamlit as st
import plotly.graph_objects as go
import pandas as pd
import requests
import time

# --- PAGE CONFIG ---
st.set_page_config(
    page_title="AMD Earnings Trend Analyzer",
    page_icon="\ud83d\udcc8",
    layout="wide",
)

# --- SEC EDGAR DATA PIPELINE ---
@st.cache_data(ttl=86400)
def fetch_sec_edgar_facts():
    url = "https://data.sec.gov/api/xbrl/companyfacts/CIK0000002488.json"
    headers = {
        "User-Agent": "AMDEarningsAnalyzer contact@example.com",
        "Accept-Encoding": "gzip, deflate",
    }
    try:
        response = requests.get(url, headers=headers)
        time.sleep(0.12)
        if response.status_code == 200:
            data = response.json()
            return {
                "entity_name": data.get("entityName", "N/A"),
                "cik": data.get("cik", "N/A"),
                "facts_available": len(data.get("facts", {}).get("us-gaap", {})),
            }
    except requests.exceptions.RequestException:
        pass
    return None


def get_amd_quarterly_data():
    data = {
        "Quarter": ["Q1'24", "Q4'24", "Q1'25", "Q4'25", "Q1'26"],
        "Data Center": [2337, 3859, 3674, 5380, 5775],
        "Client": [1368, 2313, 2294, 3097, 2885],
        "Gaming": [922, 563, 647, 843, 720],
        "Embedded": [846, 923, 823, 950, 873],
        "Total Revenue": [5473, 7658, 7438, 10270, 10253],
        "Non-GAAP EPS": [0.62, 1.09, 0.96, 0.92, 1.37],
    }
    return pd.DataFrame(data)


def calculate_metrics(df):
    df["DC YoY Growth %"] = None
    df.loc[df["Quarter"] == "Q1'25", "DC YoY Growth %"] = round(
        (3674 - 2337) / 2337 * 100, 1
    )
    df.loc[df["Quarter"] == "Q1'26", "DC YoY Growth %"] = round(
        (5775 - 3674) / 3674 * 100, 1
    )
    df["DC Mix %"] = round(df["Data Center"] / df["Total Revenue"] * 100, 1)
    return df


# --- LOAD DATA ---
df = get_amd_quarterly_data()
df = calculate_metrics(df)
sec_info = fetch_sec_edgar_facts()

# --- HEADER ---
st.title("AMD Earnings Trend Analyzer")
st.markdown(
    "Tracking AMD's transformation into an AI infrastructure company. "
    "Data Center revenue doubled from $2.3B to $5.8B in 8 quarters."
)

if sec_info:
    st.caption(
        f"SEC EDGAR connected: {sec_info['entity_name']} | "
        f"CIK: {sec_info['cik']} | "
        f"{sec_info['facts_available']} XBRL facts available"
    )

st.divider()

# --- KPI CARDS ---
latest = df.iloc[-1]
prior_year = df[df["Quarter"] == "Q1'25"].iloc[0]

col1, col2, col3, col4 = st.columns(4)
with col1:
    st.metric(
        label="Total Revenue",
        value=f"${latest['Total Revenue'] / 1000:.1f}B",
        delta=f"{((latest['Total Revenue'] - prior_year['Total Revenue']) / prior_year['Total Revenue'] * 100):.0f}% YoY",
    )
with col2:
    st.metric(
        label="Data Center Revenue",
        value=f"${latest['Data Center'] / 1000:.1f}B",
        delta=f"{latest['DC YoY Growth %']:.0f}% YoY",
    )
with col3:
    st.metric(
        label="DC Revenue Mix",
        value=f"{latest['DC Mix %']:.0f}%",
        delta=f"+{latest['DC Mix %'] - df[df['Quarter'] == 'Q1\\'24'].iloc[0]['DC Mix %']:.0f} ppts vs Q1'24",
    )
with col4:
    st.metric(
        label="Non-GAAP EPS",
        value=f"${latest['Non-GAAP EPS']:.2f}",
        delta=f"+${latest['Non-GAAP EPS'] - prior_year['Non-GAAP EPS']:.2f} vs Q1'25",
    )

st.divider()

# --- FILTER ---
time_range = st.selectbox(
    "Time Range",
    ["Last 3 Quarters", "Last 5 Quarters (All)"],
    index=1,
)

if time_range == "Last 3 Quarters":
    filtered_df = df.tail(3)
else:
    filtered_df = df

# --- CHART PLACEHOLDERS ---
left_col, right_col = st.columns([2, 1])

Your dashboard now has a professional header, four headline KPI cards, and a time range filter. Next up, you will fill those two columns with interactive Plotly charts that visualize AMD's revenue transformation.

Build Interactive Plotly Visualizations

Your dashboard layout is in place with KPI cards and column placeholders. The structure is ready, but the panels are empty.

In this step, you will fill those panels with interactive Plotly charts that tell the story of AMD's revenue shift. Each chart answers a different analytical question: how did segments trend over time, what does the revenue mix look like today versus two years ago, and how fast is the Data Center segment growing.

In this step, get ready to:
  • Build a stacked area chart showing quarterly revenue by segment.
  • Create side-by-side donut charts comparing Q1'26 and Q1'24 revenue mix.
  • Add a full-width bar chart and a narrative insight section.
Create the stacked area chart in the left column

The left panel is the widest column in your layout. A stacked area chart works well here because it shows both individual segment performance and how they combine into total revenue over time.

  • In streamlit_app.py, find this comment near the bottom of the file:
# --- CHART PLACEHOLDERS ---
  • Replace it with:
# --- CHARTS ---
  • Now add the stacked area chart inside the left column. Find the line left_col, right_col = st.columns([2, 1]) and paste the following code directly below it:
with left_col:
    st.subheader("Revenue by Segment (Quarterly)")
    fig_trend = go.Figure()
    colors = {
        "Data Center": "#1f77b4",
        "Client": "#ff7f0e",
        "Gaming": "#2ca02c",
        "Embedded": "#9467bd",
    }
    for segment in ["Data Center", "Client", "Gaming", "Embedded"]:
        fig_trend.add_trace(
            go.Scatter(
                x=filtered_df["Quarter"],
                y=filtered_df[segment],
                name=segment,
                mode="lines+markers",
                line=dict(width=3, color=colors[segment]),
                stackgroup="one",
                hovertemplate=f"{segment}: $%{{y:,.0f}}M<extra></extra>",
            )
        )
    fig_trend.update_layout(
        yaxis_title="Revenue ($M)",
        hovermode="x unified",
        legend=dict(orientation="h", yanchor="bottom", y=1.02),
        margin=dict(l=40, r=20, t=40, b=40),
        height=400,
    )
    st.plotly_chart(fig_trend, use_container_width=True)

What does this code do?

This creates a stacked area chart using Plotly's go.Scatter traces. Each segment gets its own trace with a unique color from the colors dictionary.

  • stackgroup="one" stacks all four segments on top of each other so you see both individual and total revenue.
  • filtered_df is the DataFrame filtered by the time range selectbox from the previous step.
  • hovertemplate controls what the learner sees when hovering over a data point.
  • Save streamlit_app.py.
  • Switch to your browser tab running the Streamlit app (or run streamlit run streamlit_app.py if it is not already running). You should see a colorful stacked area chart in the left panel with four layered segments.

Don't see the chart?

  • Make sure the with left_col: block is directly below the left_col, right_col = st.columns([2, 1]) line. Indentation inside the with block must be 4 spaces.
  • If you see an error about filtered_df not being defined, check that the filter selectbox code from the previous step is still above this section.
  • help me debug my stacked area chart
Create the revenue mix donut charts in the right column

The right column shows two donut charts stacked vertically. Placing Q1'26 on top and Q1'24 below creates an instant visual comparison of how AMD's revenue mix shifted toward Data Center.

  • In streamlit_app.py, paste the following code directly below the with left_col: block you just added (at the same indentation level, not inside it):
with right_col:
    st.subheader("Revenue Mix: Q1'26")
    latest_segments = {
        "Data Center": latest["Data Center"],
        "Client": latest["Client"],
        "Gaming": latest["Gaming"],
        "Embedded": latest["Embedded"],
    }
    fig_donut = go.Figure(
        data=[
            go.Pie(
                labels=list(latest_segments.keys()),
                values=list(latest_segments.values()),
                hole=0.5,
                marker_colors=["#1f77b4", "#ff7f0e", "#2ca02c", "#9467bd"],
                hovertemplate="%{label}: $%{value:,.0f}M (%{percent})<extra></extra>",
            )
        ]
    )
    fig_donut.update_layout(
        margin=dict(l=20, r=20, t=20, b=20),
        height=200,
        showlegend=False,
    )
    st.plotly_chart(fig_donut, use_container_width=True)

    st.subheader("Revenue Mix: Q1'24")
    q1_24 = df[df["Quarter"] == "Q1'24"].iloc[0]
    q1_24_segments = {
        "Data Center": q1_24["Data Center"],
        "Client": q1_24["Client"],
        "Gaming": q1_24["Gaming"],
        "Embedded": q1_24["Embedded"],
    }
    fig_donut_old = go.Figure(
        data=[
            go.Pie(
                labels=list(q1_24_segments.keys()),
                values=list(q1_24_segments.values()),
                hole=0.5,
                marker_colors=["#1f77b4", "#ff7f0e", "#2ca02c", "#9467bd"],
                hovertemplate="%{label}: $%{value:,.0f}M (%{percent})<extra></extra>",
            )
        ]
    )
    fig_donut_old.update_layout(
        margin=dict(l=20, r=20, t=20, b=20),
        height=200,
        showlegend=False,
    )
    st.plotly_chart(fig_donut_old, use_container_width=True)

What does this code do?

This creates two donut charts inside the narrower right column using go.Pie with hole=0.5 to carve out the center.

  • The top donut uses latest_segments (Q1'26 data) where Data Center dominates at 56% of revenue.
  • The bottom donut uses q1_24_segments (Q1'24 data) where Data Center was 43%. The visual difference tells the story instantly.
  • Both use the same color palette as the area chart so segments are visually consistent across all visualizations.
  • Save streamlit_app.py and refresh your browser.
  • You should see two donut charts stacked in the right panel. The top donut (Q1'26) shows a large blue Data Center slice, and the bottom donut (Q1'24) shows a more evenly distributed mix.

Donuts look squished or overlap?

  • Check that height=200 is set in both update_layout() calls. A larger value pushes them off-screen in the narrow column.
  • Make sure the with right_col: block is at the same indentation level as with left_col:. They are siblings, not nested.
  • help me fix my donut chart layout
Add the Data Center growth bar chart and narrative

The final section goes full-width below the two-column layout. A bar chart makes the Data Center growth trajectory immediately scannable, and a narrative section anchors the analytical insight for anyone viewing the dashboard.

  • In streamlit_app.py, paste the following code below the with right_col: block (outside both column blocks, at the top indentation level):
# --- DATA CENTER GROWTH BAR CHART ---
st.subheader("Data Center Revenue Growth Trajectory")
dc_data = df[["Quarter", "Data Center", "DC YoY Growth %"]]
fig_dc = go.Figure()
fig_dc.add_trace(
    go.Bar(
        x=dc_data["Quarter"],
        y=dc_data["Data Center"],
        marker_color="#1f77b4",
        text=[f"${v / 1000:.1f}B" for v in dc_data["Data Center"]],
        textposition="outside",
        hovertemplate="Q: %{x}<br>Revenue: $%{y:,.0f}M<extra></extra>",
    )
)
fig_dc.update_layout(
    yaxis_title="Data Center Revenue ($M)",
    margin=dict(l=40, r=20, t=20, b=40),
    height=350,
)
st.plotly_chart(fig_dc, use_container_width=True)

What does this code do?

  • go.Bar creates a vertical bar chart using all 5 quarters of Data Center revenue.
  • The text parameter formats each bar's label as dollars in billions (e.g. $5.8B). textposition="outside" places labels above the bars for readability.
  • This chart sits at full page width because it is outside both column blocks.
  • Save streamlit_app.py and refresh your browser.
  • You should see a full-width bar chart below the two-column section with 5 bars growing from left to right, each labeled with a dollar amount.

Bar labels cut off at the top?

  • Verify that height=350 is set in update_layout(). Too small a height crops the outside-positioned text labels.
  • Check that the bar chart code is NOT inside a with left_col: or with right_col: block. It should be at the same indentation as those with statements.
  • help me debug my bar chart positioning
  • Now add the narrative section that anchors the analytical insight. Paste this code directly below the bar chart's st.plotly_chart(fig_dc, use_container_width=True) line:
# --- NARRATIVE ---
st.markdown("---")
st.markdown(
    """
    **Key Insight:** AMD's Data Center revenue grew from $2.3B (Q1'24) to $5.8B
    (Q1'26), sustaining 57% YoY growth for two consecutive first quarters. This
    segment now accounts for 56% of total revenue, up from 43% two years ago.
    The growth is driven by EPYC CPU share gains in cloud/enterprise and the ramp
    of Instinct GPUs for AI training and inference workloads. Meta has committed
    to deploying up to 6 GW of AMD Instinct GPUs across its AI data centers.

    *Data sources: AMD Q1 2025 and Q1 2026 earnings press releases (SEC 8-K filings),
    SEC EDGAR XBRL API (CIK 0000002488).*
    """
)

Why include a narrative section?

Professional dashboards do not just show charts. They surface the "so what" for the viewer. This narrative calls out the specific growth trajectory, names the drivers (EPYC CPUs and Instinct GPUs), and cites sources.

Recruiters and hiring managers reviewing your portfolio can immediately see that you understand how to communicate data insights, not just plot numbers.

  • Save streamlit_app.py and refresh your browser.
  • Scroll to the bottom of your dashboard. You should see a horizontal rule followed by a bold "Key Insight" paragraph and an italicized data sources citation.

Narrative text not rendering markdown formatting?

  • Make sure you are using triple-quoted strings (""") inside st.markdown(). Single-line strings with **bold** markers also work, but the triple-quote approach handles multi-line text cleanly.
  • help me fix my markdown narrative section

✔️ Awesome, I've got everything!

Great. Double check you have saved streamlit_app.py and that all four visualizations (area chart, two donuts, bar chart) plus the narrative render in your browser.

ⓧ I'd like to double check the full code

Here is the complete streamlit_app.py as it should look at the end of this step:

import streamlit as st
import plotly.graph_objects as go
import pandas as pd
import requests
import time

# --- PAGE CONFIG ---
st.set_page_config(
    page_title="AMD Earnings Trend Analyzer",
    page_icon="📈",
    layout="wide",
)

# --- SEC EDGAR DATA PIPELINE ---
@st.cache_data(ttl=86400)
def fetch_sec_edgar_facts():
    url = "https://data.sec.gov/api/xbrl/companyfacts/CIK0000002488.json"
    headers = {
        "User-Agent": "AMDEarningsAnalyzer contact@example.com",
        "Accept-Encoding": "gzip, deflate",
    }
    try:
        response = requests.get(url, headers=headers)
        time.sleep(0.12)
        if response.status_code == 200:
            data = response.json()
            return {
                "entity_name": data.get("entityName", "N/A"),
                "cik": data.get("cik", "N/A"),
                "facts_available": len(data.get("facts", {}).get("us-gaap", {})),
            }
    except requests.exceptions.RequestException:
        pass
    return None


def get_amd_quarterly_data():
    data = {
        "Quarter": ["Q1'24", "Q4'24", "Q1'25", "Q4'25", "Q1'26"],
        "Data Center": [2337, 3859, 3674, 5380, 5775],
        "Client": [1368, 2313, 2294, 3097, 2885],
        "Gaming": [922, 563, 647, 843, 720],
        "Embedded": [846, 923, 823, 950, 873],
        "Total Revenue": [5473, 7658, 7438, 10270, 10253],
        "Non-GAAP EPS": [0.62, 1.09, 0.96, 0.92, 1.37],
    }
    return pd.DataFrame(data)


def calculate_metrics(df):
    df["DC YoY Growth %"] = None
    df.loc[df["Quarter"] == "Q1'25", "DC YoY Growth %"] = round(
        (3674 - 2337) / 2337 * 100, 1
    )
    df.loc[df["Quarter"] == "Q1'26", "DC YoY Growth %"] = round(
        (5775 - 3674) / 3674 * 100, 1
    )
    df["DC Mix %"] = round(df["Data Center"] / df["Total Revenue"] * 100, 1)
    return df


# --- LOAD DATA ---
df = get_amd_quarterly_data()
df = calculate_metrics(df)
sec_info = fetch_sec_edgar_facts()

# --- HEADER ---
st.title("AMD Earnings Trend Analyzer")
st.markdown(
    "Tracking AMD's transformation into an AI infrastructure company. "
    "Data Center revenue doubled from $2.3B to $5.8B in 8 quarters."
)

if sec_info:
    st.caption(
        f"SEC EDGAR connected: {sec_info['entity_name']} | "
        f"CIK: {sec_info['cik']} | "
        f"{sec_info['facts_available']} XBRL facts available"
    )

st.divider()

# --- KPI CARDS ---
latest = df.iloc[-1]
prior_year = df[df["Quarter"] == "Q1'25"].iloc[0]

col1, col2, col3, col4 = st.columns(4)
with col1:
    st.metric(
        label="Total Revenue",
        value=f"${latest['Total Revenue'] / 1000:.1f}B",
        delta=f"{((latest['Total Revenue'] - prior_year['Total Revenue']) / prior_year['Total Revenue'] * 100):.0f}% YoY",
    )
with col2:
    st.metric(
        label="Data Center Revenue",
        value=f"${latest['Data Center'] / 1000:.1f}B",
        delta=f"{latest['DC YoY Growth %']:.0f}% YoY",
    )
with col3:
    st.metric(
        label="DC Revenue Mix",
        value=f"{latest['DC Mix %']:.0f}%",
        delta=f"+{latest['DC Mix %'] - df[df['Quarter'] == \"Q1'24\"].iloc[0]['DC Mix %']:.0f} ppts vs Q1'24",
    )
with col4:
    st.metric(
        label="Non-GAAP EPS",
        value=f"${latest['Non-GAAP EPS']:.2f}",
        delta=f"+${latest['Non-GAAP EPS'] - prior_year['Non-GAAP EPS']:.2f} vs Q1'25",
    )

st.divider()

# --- FILTER ---
time_range = st.selectbox(
    "Time Range",
    ["Last 3 Quarters", "Last 5 Quarters (All)"],
    index=1,
)

if time_range == "Last 3 Quarters":
    filtered_df = df.tail(3)
else:
    filtered_df = df

# --- CHARTS ---
left_col, right_col = st.columns([2, 1])

with left_col:
    st.subheader("Revenue by Segment (Quarterly)")
    fig_trend = go.Figure()
    colors = {
        "Data Center": "#1f77b4",
        "Client": "#ff7f0e",
        "Gaming": "#2ca02c",
        "Embedded": "#9467bd",
    }
    for segment in ["Data Center", "Client", "Gaming", "Embedded"]:
        fig_trend.add_trace(
            go.Scatter(
                x=filtered_df["Quarter"],
                y=filtered_df[segment],
                name=segment,
                mode="lines+markers",
                line=dict(width=3, color=colors[segment]),
                stackgroup="one",
                hovertemplate=f"{segment}: $%{{y:,.0f}}M<extra></extra>",
            )
        )
    fig_trend.update_layout(
        yaxis_title="Revenue ($M)",
        hovermode="x unified",
        legend=dict(orientation="h", yanchor="bottom", y=1.02),
        margin=dict(l=40, r=20, t=40, b=40),
        height=400,
    )
    st.plotly_chart(fig_trend, use_container_width=True)

with right_col:
    st.subheader("Revenue Mix: Q1'26")
    latest_segments = {
        "Data Center": latest["Data Center"],
        "Client": latest["Client"],
        "Gaming": latest["Gaming"],
        "Embedded": latest["Embedded"],
    }
    fig_donut = go.Figure(
        data=[
            go.Pie(
                labels=list(latest_segments.keys()),
                values=list(latest_segments.values()),
                hole=0.5,
                marker_colors=["#1f77b4", "#ff7f0e", "#2ca02c", "#9467bd"],
                hovertemplate="%{label}: $%{value:,.0f}M (%{percent})<extra></extra>",
            )
        ]
    )
    fig_donut.update_layout(
        margin=dict(l=20, r=20, t=20, b=20),
        height=200,
        showlegend=False,
    )
    st.plotly_chart(fig_donut, use_container_width=True)

    st.subheader("Revenue Mix: Q1'24")
    q1_24 = df[df["Quarter"] == "Q1'24"].iloc[0]
    q1_24_segments = {
        "Data Center": q1_24["Data Center"],
        "Client": q1_24["Client"],
        "Gaming": q1_24["Gaming"],
        "Embedded": q1_24["Embedded"],
    }
    fig_donut_old = go.Figure(
        data=[
            go.Pie(
                labels=list(q1_24_segments.keys()),
                values=list(q1_24_segments.values()),
                hole=0.5,
                marker_colors=["#1f77b4", "#ff7f0e", "#2ca02c", "#9467bd"],
                hovertemplate="%{label}: $%{value:,.0f}M (%{percent})<extra></extra>",
            )
        ]
    )
    fig_donut_old.update_layout(
        margin=dict(l=20, r=20, t=20, b=20),
        height=200,
        showlegend=False,
    )
    st.plotly_chart(fig_donut_old, use_container_width=True)

# --- DATA CENTER GROWTH BAR CHART ---
st.subheader("Data Center Revenue Growth Trajectory")
dc_data = df[["Quarter", "Data Center", "DC YoY Growth %"]]
fig_dc = go.Figure()
fig_dc.add_trace(
    go.Bar(
        x=dc_data["Quarter"],
        y=dc_data["Data Center"],
        marker_color="#1f77b4",
        text=[f"${v / 1000:.1f}B" for v in dc_data["Data Center"]],
        textposition="outside",
        hovertemplate="Q: %{x}<br>Revenue: $%{y:,.0f}M<extra></extra>",
    )
)
fig_dc.update_layout(
    yaxis_title="Data Center Revenue ($M)",
    margin=dict(l=40, r=20, t=20, b=40),
    height=350,
)
st.plotly_chart(fig_dc, use_container_width=True)

# --- NARRATIVE ---
st.markdown("---")
st.markdown(
    """
    **Key Insight:** AMD's Data Center revenue grew from $2.3B (Q1'24) to $5.8B
    (Q1'26), sustaining 57% YoY growth for two consecutive first quarters. This
    segment now accounts for 56% of total revenue, up from 43% two years ago.
    The growth is driven by EPYC CPU share gains in cloud/enterprise and the ramp
    of Instinct GPUs for AI training and inference workloads. Meta has committed
    to deploying up to 6 GW of AMD Instinct GPUs across its AI data centers.

    *Data sources: AMD Q1 2025 and Q1 2026 earnings press releases (SEC 8-K filings),
    SEC EDGAR XBRL API (CIK 0000002488).*
    """
)

Your dashboard now tells a complete visual story. Next up, you will deploy it to Streamlit Community Cloud so anyone can view it from a shareable URL.

Deploy to Streamlit Community Cloud

Your dashboard runs beautifully on your local machine. Now it is time to put it on the internet so anyone with a link can explore your AMD earnings analysis.

Streamlit Community Cloud is a free hosting service that pulls your code directly from a GitHub repository and deploys it as a live web app. Every time you push new code, the app updates automatically.

In this step, get ready to:
  • Push your project to a GitHub repository.
  • Deploy the app on Streamlit Community Cloud.
  • Verify your live dashboard URL.
Initialize a Git repository and push to GitHub

Streamlit Community Cloud reads your code from a GitHub repository. You need to create a repo, commit your files, and push them to GitHub before deploying.

  • Open your browser and go to github.com.
  • Click the + icon in the top-right corner, then click New repository.
  • Enter amd-earnings-analyzer as the repository name.
  • Leave the repository set to Public.
  • Do not check any of the initialization options (no README, no .gitignore, no license).
  • Click Create repository.

Why an empty repository?

You already have files locally. If GitHub adds a README or .gitignore during creation, you will hit a merge conflict on your first push. An empty repo lets you push your existing files cleanly.

GitHub shows a quick setup page after creation. Leave that page open. You will use the URL it displays in a moment.

  • Switch back to your terminal in VS Code and initialize the repository by running these commands:
git init
git add .
git commit -m "AMD Earnings Trend Analyzer"

What do these commands do?

git init creates a new Git repository in your current folder. git add . stages all your files for commit. git commit saves a snapshot of your project with a descriptive message.

  • Connect your local repo to GitHub and push your code by running these commands:
git branch -M main
git remote add origin https://github.com/[[GITHUB_USERNAME="YOUR_USERNAME"]]/amd-earnings-analyzer.git
git push -u origin main

What do these commands do?

git branch -M main renames your default branch to main. git remote add origin connects your local repo to the GitHub repository you just created. git push -u origin main uploads your committed files to GitHub.

  • Refresh the GitHub repository page in your browser. You should see streamlit_app.py and requirements.txt listed in the repository.

Push failed or permission denied?

If you see a permission error, you may need to authenticate with GitHub. Run git push again and enter your GitHub username and a personal access token (not your password) when prompted. You can create a token in GitHub under Settings then Developer settings then Personal access tokens.

Help me fix a Git push authentication error for my GitHub repository.

Deploy on Streamlit Community Cloud

With your code on GitHub, you can now connect it to Streamlit Community Cloud for a free, live deployment.

  • Open a new browser tab and go to share.streamlit.io.
  • Click Continue to sign-in, then click Continue with GitHub.
  • Enter your GitHub credentials and authorize Streamlit to access your repositories.

First time on Streamlit Community Cloud?

If this is your first visit, you will need to fill in your account information and accept the terms. Streamlit will ask to connect to your GitHub account. Click Authorize streamlit when prompted. This lets Community Cloud pull code from your public repositories.

  • In the upper-right corner of your workspace, click Create app.
  • When asked if you already have an app, select Yup, I have an app.
  • In the Repository field, select your amd-earnings-analyzer repository from the dropdown.
  • Set the Branch to main.
  • Set the Main file path to streamlit_app.py.
  • Click Deploy.

You will see a message that your app is building. Streamlit reads your requirements.txt, installs the dependencies, and starts your app. This typically takes 2-3 minutes.

Deploy button grayed out or not responding?

Make sure your repository is public. Streamlit Community Cloud requires admin permissions on the repo to deploy. If the button remains grayed out, go to your Streamlit account Settings, then Linked accounts, and re-link your GitHub account.

Help me troubleshoot my Streamlit Community Cloud deployment.

Verify your live deployment

Once the build finishes, Streamlit redirects you to your live app URL. This is the same dashboard you built locally, now accessible to anyone on the internet.

  • Wait for the build to complete. Your dashboard should appear with the KPI cards, charts, and narrative section fully rendered.
  • Check the URL bar. Your app URL follows the pattern your-app-name.streamlit.app.
  • Click through the interactive elements to confirm everything works. Toggle the Time Range dropdown and hover over the charts to verify interactivity.
  • Copy the URL from your browser's address bar. This is your shareable portfolio link.

What happens if the app sleeps?

Streamlit Community Cloud puts apps to sleep after a period of inactivity. When someone visits the URL, the app wakes up automatically. No action needed on your part.

Keep your app updated

Any time you push new commits to the main branch of your GitHub repository, Streamlit automatically rebuilds and redeploys your app. No manual redeployment needed.

Secret mission

Add YoY Comparison Toggle and CSV Export

Your dashboard tells AMD's story, but recruiters want to interact with the data themselves. Add a YoY comparison toggle that overlays prior-year benchmarks on your trend chart, a downloadable CSV export, and a data methodology section that builds credibility with anyone reviewing your portfolio.

Clean Up Your Resources

Clean Up Your Resources

This project runs entirely locally and deploys to Streamlit Community Cloud for free. There are no ongoing costs, so you can safely leave everything running without being charged.

Decide whether to keep your resources running, pause them to come back later, or delete them entirely.

Resources you used:

  • Local project folder (amd-earnings-analyzer on your Desktop) with Python virtual environment.
  • GitHub repository (amd-earnings-analyzer).
  • Streamlit Community Cloud app deployment.

Keep everything running

No action needed. Choose this if you plan to keep iterating on the dashboard or want to keep the live URL active for your portfolio.

  • Your Streamlit Community Cloud app stays live for free. If it goes to sleep after inactivity, it wakes up automatically when someone visits the URL.
  • Your GitHub repository remains available as a portfolio artifact.
  • Your local project folder and virtual environment stay on your Desktop.

Pause - I'll come back to this later

Stop any running processes to free up local memory. Your deployed app and GitHub repo stay intact.

  • In your terminal, press Ctrl+C to stop the local Streamlit server if it is still running.
  • Deactivate your virtual environment by running:
deactivate
  • Your Streamlit Community Cloud deployment remains live. No action needed there.
  • When you return, reactivate the virtual environment by navigating to the project folder and running venv\Scripts\activate (Windows) or source venv/bin/activate (macOS/Linux).

Delete - I don't want to use this again

Remove all project resources from your machine, GitHub, and Streamlit Community Cloud.

Delete the Streamlit Community Cloud app:

  • Go to your workspace at share.streamlit.io.
  • Click the overflow menu icon next to your app.
  • Click Delete.
  • Enter the confirmation string and click Delete to confirm.

Delete the GitHub repository:

  • Go to your amd-earnings-analyzer repository on GitHub.
  • Click Settings.
  • Scroll down to the Danger Zone section and click Delete this repository.
  • Click I want to delete this repository.
  • Click I have read and understand these effects.
  • Type the repository name to confirm, then click Delete this repository.

Delete the local project folder:

  • In your terminal, run the appropriate command for your operating system:

macOS

cd ~/Desktop
rm -rf amd-earnings-analyzer

Windows

cd ~\Desktop
rmdir /s /q amd-earnings-analyzer

Nice Work!

Nice Work!

Nice work! You just built a live, interactive earnings dashboard that tells the story of AMD's transformation into an AI infrastructure company. You pulled real financial data from the SEC's free API, visualized multi-quarter trends with professional charts, and deployed the whole thing to a shareable URL.

You've learned how to:

  • Build a SEC EDGAR data pipeline that programmatically fetches company financial facts from the free XBRL API using Python and requests.
  • Create interactive Plotly visualizations (stacked area charts, donut charts, bar charts) inside a Streamlit dashboard with KPI cards, filters, and hover-enabled data exploration.
  • Deploy a Python data app to Streamlit Community Cloud for free, producing a live portfolio URL backed by a GitHub repository.
  • Secret Mission: Added a YoY comparison toggle overlaying prior-year data on the trend chart, a CSV download button for the underlying data, and an About This Data expander for recruiter-friendly source documentation.

Ready to quiz yourself?