Skip to main content

A Python wrapper to fetch financial data from Morningstar

Project description

MorningPy

A modern Python library for financial data — Stocks, ETFs, Funds, Indices, Financial Statements, Timeseries, and News.

Testing / CI Tests Codecov
Package PyPI Python 3.11+
Meta Docs License Code Style

Overview

MorningPy provides a Pythonic and intuitive interface to access financial and market data from Morningstar.com.
It is designed for students, practitioners, and researchers who need fast, consistent, and transparent access to high-quality market information.

MorningPy enables professional-grade data handling and covers a wide range of financial instruments, including:

  • Stocks, ETFs, Funds, Indices
  • Financial Statements and Holdings
  • Historical and Intraday Timeseries
  • News and Market Updates
  • Ticker conversion

News

  • First version of MorningPy released — excited to start the journey! 🎉

Installation

Install from PyPI:

pip install morningpy

Install from source:

git clone https://github.com/ThomasPiton/morningpy.git
pip install -e morningpy

Usage

Importing modules:

# Market data
from morningpy.api.market import (
    get_market_us_calendar_info,
    get_market_commodities,
    get_market_currencies,
    get_market_movers,
    get_market_indexes,
    get_market_fair_value,
    get_market_info
)

# Timeseries data
from morningpy.api.timeseries import (
    get_intraday_timeseries,
    get_historical_timeseries
)

# Security data
from morningpy.api.security import (
    get_financial_statement,
    get_holding,
    get_holding_info
)

# Ticker info
from morningpy.api.ticker import (
    get_all_etfs,
    get_all_funds,
    get_all_stocks,
    get_all_securities,
    convert
)

# News
from morningpy.api.news import get_headline_news

Examples - Market Information:

from morningpy.api.market import (
    get_market_us_calendar_info,
    get_market_commodities,
    get_market_currencies,
    get_market_movers,
    get_market_indexes,
    get_market_fair_value,
    get_market_info
)

# US earnings calendar
calendar_info = get_market_us_calendar_info(date=["2025-11-12"], info_type="earnings")
print(calendar_info.head())

# Commodities and currencies
commodities = get_market_commodities()
currencies = get_market_currencies()

# Market movers
movers = get_market_movers(mover_type=["gainers", "losers", "actives"])

# Indexes and fair value
indexes = get_market_indexes(index_type=["americas", "us"])
fair_value = get_market_fair_value(value_type=["overvaluated", "undervaluated"])

# General market info
market_info = get_market_info(info_type=["global_barometer","commodities"])

Examples - Timeseries:

from morningpy.api.timeseries import (
    get_intraday_timeseries,
    get_historical_timeseries
)

# Intraday data
intraday = get_intraday_timeseries(
    security_id=["0P00009WL3"],
    start_date="2024-11-08",
    end_date="2025-11-07",
    frequency="1min",
    pre_after=False
)

# Historical daily data
historical = get_historical_timeseries(
    security_id=["0P0000OQN8","0P0001RWKZ"],
    start_date="2010-11-05",
    end_date="2025-11-05",
    frequency="daily",
    pre_after=False
)

Examples - Security:

from morningpy.api.security import (
    get_financial_statement,
    get_holding,
    get_holding_info
)

# Financial statement
income_statement = get_financial_statement(
    statement_type="Income Statement",
    report_frequency="Quarterly",
    security_id=["0P000115U4"]
)

# Holdings
holding_info = get_holding_info(
    performance_id=["0P0001PU03", "0P0001BG3E"]
)
holding = get_holding(
    performance_id=["0P0001PU03", "0P00013Z57"]
)

Examples - Ticker:

from morningpy.api.ticker import (
    get_all_etfs,
    get_all_funds,
    get_all_stocks,
    get_all_securities,
    convert
)

# Retrieve all ETFs
etfs = get_all_etfs()

# Retrieve all stocks and funds
stocks = get_all_stocks()
funds = get_all_funds()

# Convert ticker or ISIN
converted = convert(["US7181721090", "0P0001PU03"])

Examples - News:

from morningpy.api.news import get_headline_news

# Get headline news
news = get_headline_news(
    market="Spain",
    news="economy",
    edition="Central Europe"
)
print(news.head())

Documentation

Advanced documentation will be available at MorningPy Docs

Contribution

Contributions are always welcome! You can:

  • Open an issue to discuss a feature or bug
  • Submit a pull request
  • Contact us to discuss the best way to contribute

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

morningpy-0.1.3.tar.gz (17.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

morningpy-0.1.3-py3-none-any.whl (7.5 MB view details)

Uploaded Python 3

File details

Details for the file morningpy-0.1.3.tar.gz.

File metadata

  • Download URL: morningpy-0.1.3.tar.gz
  • Upload date:
  • Size: 17.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for morningpy-0.1.3.tar.gz
Algorithm Hash digest
SHA256 eb942215b4693040d44838a6f93b27c140a3c7f6a6e608844d27d74e1b032c52
MD5 04c469d87d9a5602d2176a7e90ec882f
BLAKE2b-256 3c200268a22fe5c31b3f85cc7ed8974b94595a6a7191635ba120cc6b35a22ad6

See more details on using hashes here.

File details

Details for the file morningpy-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: morningpy-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for morningpy-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 277ba116aed306d294c14ee16a11f7419aa0f7117317edaab5055033a2e06ec4
MD5 0f12e7c30c41971829735f1e46286e51
BLAKE2b-256 4f4af7934aead9c25980a9fc2c87d3c86bb12c9466a14561acd54403143a9d21

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page