Introduction
In this tutorial, you'll learn how to build a financial dashboard that tracks and compares the valuations of major AI companies like Anthropic and OpenAI. This project combines web scraping, data analysis, and visualization techniques to create a practical tool that demonstrates real-time financial tracking of AI startups. We'll use Python with libraries like requests, pandas, and matplotlib to analyze company valuation data and visualize trends.
Prerequisites
- Basic Python knowledge
- Installed Python 3.8+
- Required packages: requests, pandas, matplotlib, seaborn
- Understanding of financial metrics and company valuations
Step-by-step Instructions
Step 1: Set up your development environment
First, create a new Python virtual environment and install the required packages. This ensures you have a clean environment for our project.
Install required packages
python -m venv ai_dashboard_env
source ai_dashboard_env/bin/activate # On Windows: ai_dashboard_env\Scripts\activate
pip install requests pandas matplotlib seaborn
Why: Creating a virtual environment isolates our project dependencies from system-wide packages, preventing conflicts and ensuring reproducible results.
Step 2: Create a data collection module
Next, we'll create a module to collect financial data from public sources. This simulates how you might gather real-time valuation data from financial APIs or news sources.
Build the data collection script
import requests
import pandas as pd
import time
# Mock data representing company valuations
mock_data = {
'company': ['Anthropic', 'OpenAI'],
'valuation_2024': [180, 250], # In billions
'valuation_2025': [450, 300], # In billions
'revenue_2024': [9, 15], # In billions
'revenue_2025': [45, 20], # In billions
'growth_rate': [200, 100] # Percentage growth
}
def get_company_data():
"""Simulate fetching company data from financial sources"""
df = pd.DataFrame(mock_data)
return df
if __name__ == "__main__":
data = get_company_data()
print(data)
Why: This module simulates the data collection process. In a real scenario, you would integrate with financial APIs like Yahoo Finance, Bloomberg, or specialized AI company trackers.
Step 3: Analyze the valuation trends
Now we'll analyze the growth patterns and calculate key metrics that help understand the valuation dynamics.
Create analysis functions
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# Load the data
company_data = get_company_data()
# Calculate growth metrics
company_data['valuation_growth'] = ((company_data['valuation_2025'] - company_data['valuation_2024']) / company_data['valuation_2024']) * 100
company_data['revenue_growth'] = ((company_data['revenue_2025'] - company_data['revenue_2024']) / company_data['revenue_2024']) * 100
# Display results
print("\nCompany Valuation Analysis:")
print(company_data[['company', 'valuation_2024', 'valuation_2025', 'valuation_growth']])
# Calculate relative performance
anthropic_valuation = company_data[company_data['company'] == 'Anthropic']['valuation_2025'].iloc[0]
openai_valuation = company_data[company_data['company'] == 'OpenAI']['valuation_2025'].iloc[0]
print(f"\nValuation Comparison:")
print(f"Anthropic: ${anthropic_valuation}B")
print(f"OpenAI: ${openai_valuation}B")
print(f"Anthropic is {anthropic_valuation/openai_valuation:.2f}x more valuable than OpenAI")
Why: This analysis helps understand the financial performance of both companies. The 200% valuation growth for Anthropic versus 100% for OpenAI shows the rapid expansion in the AI sector.
Step 4: Create visualizations
Visual representations help quickly understand complex financial data. We'll create charts showing valuation trends and revenue growth.
Build visualization functions
def create_valuation_chart(df):
"""Create a bar chart comparing company valuations"""
plt.figure(figsize=(10, 6))
bars = plt.bar(df['company'], df['valuation_2025'], color=['#FF6B6B', '#4ECDC4'])
plt.title('AI Company Valuations (2025)', fontsize=16, fontweight='bold')
plt.ylabel('Valuation (Billions USD)', fontsize=12)
plt.xlabel('Company', fontsize=12)
# Add value labels on bars
for bar in bars:
height = bar.get_height()
plt.text(bar.get_x() + bar.get_width()/2., height,
f'${height}B',
ha='center', va='bottom')
plt.tight_layout()
plt.savefig('valuation_comparison.png')
plt.show()
def create_growth_chart(df):
"""Create a line chart showing growth trends"""
plt.figure(figsize=(10, 6))
# Plot valuation growth
plt.plot(df['company'], df['valuation_growth'], marker='o', linewidth=2, markersize=8, label='Valuation Growth')
plt.plot(df['company'], df['revenue_growth'], marker='s', linewidth=2, markersize=8, label='Revenue Growth')
plt.title('Growth Trends: Valuation vs Revenue', fontsize=16, fontweight='bold')
plt.ylabel('Growth Rate (%)', fontsize=12)
plt.xlabel('Company', fontsize=12)
plt.legend()
plt.grid(True, alpha=0.3)
plt.tight_layout()
plt.savefig('growth_trends.png')
plt.show()
# Generate visualizations
create_valuation_chart(company_data)
create_growth_chart(company_data)
Why: Visualizations make it easier to communicate complex financial data. The bar chart clearly shows Anthropic's $900B valuation surpassing OpenAI's, while the line chart reveals the growth patterns that led to this milestone.
Step 5: Build a dashboard interface
Finally, we'll create a simple dashboard that displays all our findings in one place.
Create dashboard script
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# Set style for better-looking plots
sns.set_style("whitegrid")
plt.rcParams['figure.figsize'] = (12, 8)
# Create a comprehensive dashboard
fig = plt.figure(figsize=(15, 10))
# First subplot: Valuation comparison
ax1 = plt.subplot(2, 2, 1)
bars = ax1.bar(company_data['company'], company_data['valuation_2025'], color=['#FF6B6B', '#4ECDC4'])
ax1.set_title('Company Valuations (2025)', fontsize=14, fontweight='bold')
ax1.set_ylabel('Valuation (Billions USD)')
# Add value labels
for bar in bars:
height = bar.get_height()
ax1.text(bar.get_x() + bar.get_width()/2., height,
f'${height}B',
ha='center', va='bottom')
# Second subplot: Growth rates
ax2 = plt.subplot(2, 2, 2)
bar1 = ax2.bar(company_data['company'], company_data['valuation_growth'], color=['#FF6B6B', '#4ECDC4'])
ax2.set_title('Valuation Growth Rate', fontsize=14, fontweight='bold')
ax2.set_ylabel('Growth Rate (%)')
# Add value labels
for bar in bar1:
height = bar.get_height()
ax2.text(bar.get_x() + bar.get_width()/2., height,
f'{height:.0f}%',
ha='center', va='bottom')
# Third subplot: Revenue comparison
ax3 = plt.subplot(2, 2, 3)
revenue_bars = ax3.bar(company_data['company'], company_data['revenue_2025'], color=['#FF6B6B', '#4ECDC4'])
ax3.set_title('Annual Revenue (2025)', fontsize=14, fontweight='bold')
ax3.set_ylabel('Revenue (Billions USD)')
# Add value labels
for bar in revenue_bars:
height = bar.get_height()
ax3.text(bar.get_x() + bar.get_width()/2., height,
f'${height}B',
ha='center', va='bottom')
# Fourth subplot: Summary text
ax4 = plt.subplot(2, 2, 4)
ax4.axis('off')
summary_text = f"""Key Findings:
• Anthropic's valuation: ${anthropic_valuation}B
• OpenAI's valuation: ${openai_valuation}B
• Anthropic is {anthropic_valuation/openai_valuation:.2f}x more valuable
• Revenue growth: {company_data['revenue_growth'].max():.0f}%
• Valuation growth: {company_data['valuation_growth'].max():.0f}%
This demonstrates the rapid growth in AI valuation sector."""
ax4.text(0.1, 0.8, summary_text, fontsize=12, verticalalignment='top',
bbox=dict(boxstyle='round', facecolor='lightblue', alpha=0.7))
plt.tight_layout()
plt.savefig('ai_company_dashboard.png', dpi=300, bbox_inches='tight')
plt.show()
print("Dashboard saved as 'ai_company_dashboard.png'")
Why: A dashboard consolidates all information in one place, making it easy to share findings with others. It's particularly useful for investors or analysts tracking AI company performance.
Summary
This tutorial demonstrated how to build a financial dashboard for tracking AI company valuations, specifically focusing on the recent milestone where Anthropic's valuation surpassed OpenAI. You learned how to collect and analyze financial data, create visualizations, and build a comprehensive dashboard. The project combines web scraping techniques, data analysis with pandas, and visualization with matplotlib and seaborn. These skills are directly applicable to tracking any financial metrics and can be extended to monitor other AI companies or sectors.



