Skip to main content

savvy-mcp

Python SDK for Savvy - financial data and visualization.

Get economic indicators, stock prices, and create beautiful charts with just a few lines of code.

Installation

pip install savvy-mcp

Quick Start

import savvy

# Set your API key (or use SAVVY_API_KEY environment variable)
savvy.configure(api_key="sk_...")

# Fetch economic data (returns pandas DataFrame)
df = savvy.economic_data.fetch("UNRATE", start="2020-01-01")
print(df.head())
#         date  value
# 0 2020-01-01    3.6
# 1 2020-02-01    3.5
# 2 2020-03-01    4.4

# Fetch stock data
df = savvy.stock_data.fetch("AAPL", period="1y")

# Create a visualization
chart = savvy.visualize(df, "Stock price over time")
print(chart.url)  # https://savvy-mcp.com/c/abc123

Features

Economic Data

Access data from 20+ sources including FRED, World Bank, IMF, ECB, and more:

# US unemployment rate
df = savvy.economic_data.fetch("UNRATE")

# GDP growth with date range
df = savvy.economic_data.fetch("GDP", start="2010-01-01", end="2023-12-31")

# Search for data series
results = savvy.economic_data.search("inflation")
for r in results:
    print(f"{r['provider']}: {r['series_id']} - {r['name']}")

# Compare across countries
df = savvy.economic_data.compare("unemployment", ["US", "Germany", "Japan"])

Stock Data

Get stock prices from Yahoo Finance:

# Historical data
df = savvy.stock_data.fetch("AAPL", period="1y")
df = savvy.stock_data.fetch("MSFT", period="5y", interval="1wk")

# Current quote
quote = savvy.stock_data.quote("AAPL")
print(f"AAPL: ${quote['price']:.2f} ({quote['change_percent']:+.2f}%)")

Cryptocurrency Data

# Bitcoin price history
df = savvy.crypto_data.fetch("BTC-USD", period="1y")

# Ethereum quote
quote = savvy.crypto_data.quote("ETH")

Visualization

Create charts with natural language:

# Simple visualization
chart = savvy.visualize(df, "Line chart of stock price over time")

# With options
chart = savvy.visualize(
    df,
    "Show closing prices with a trendline",
    title="AAPL Stock Price",
    theme="executive",
)

# Access chart URLs
print(chart.url)     # Interactive HTML
print(chart.png)     # PNG image
print(chart.svg)     # SVG image
print(chart.python)  # Python code

Configuration

import savvy

# Option 1: Use configure()
savvy.configure(api_key="sk_...")

# Option 2: Environment variable (recommended for production)
# export SAVVY_API_KEY=sk_...

# Option 3: Custom API URL (for development)
savvy.configure(api_key="sk_...", api_url="https://custom.api.com")

# Read current config
print(savvy.api_key)  # Returns configured key

Error Handling

from savvy import SavvyError, AuthenticationError, DataNotFoundError

try:
    df = savvy.economic_data.fetch("INVALID_SERIES")
except DataNotFoundError as e:
    print(f"Series not found: {e.series_id}")
except AuthenticationError:
    print("Invalid API key")
except SavvyError as e:
    print(f"API error: {e}")

Data Sources

Provider Data Types Example
FRED US economic indicators UNRATE, GDP, CPIAUCSL
World Bank Global development NY.GDP.MKTP.CD
IMF Forecasts gdp_growth
ECB Eurozone rates EONIA, EURUSD
Yahoo Finance Stocks, ETFs, crypto AAPL, SPY, BTC-USD
Zillow Housing data ZHVI:San Francisco
And 15+ more...

Requirements

  • Python 3.9+
  • pandas
  • httpx

License

MIT

Metadata

Release files for savvy-mcp 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for savvy-mcp 0.2.0
File Size Uploaded Provenance
savvy_mcp-0.2.0.tar.gz 16.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for savvy-mcp 0.2.0
File Interpreter ABI Platform
savvy_mcp-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 35.6 kB

Release files / savvy_mcp-0.2.0.tar.gz

Download URL savvy_mcp-0.2.0.tar.gz
Size 16.3 kB
Tags Source
SHA-256 checksum
How to use checksums
76986e16fae44164defa1709a3149835ffa47fe0fa087cf6577045406dbb3767
BLAKE2b-256 checksum
How to use checksums
ab79d65b0857a240c741d8977dd8da3072a69a78b640f555d0998d0ecf1932a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.16

Release files / savvy_mcp-0.2.0-py3-none-any.whl

Download URL savvy_mcp-0.2.0-py3-none-any.whl
Size 19.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
76035bd540cd223979965ac5092803d1158baa092d3ade699ab2ab514503f260
BLAKE2b-256 checksum
How to use checksums
a035f68955f36aeb30eee9546c6a917fd78bb26613c2bc491e92a7f4975e261d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.16

Security for savvy-mcp 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page